A simple tool which lets you scrape twitter accounts and crosspost them to bluesky accounts! Comes with a CLI and a webapp for managing profiles! Works with images/videos/link embeds/threads.
1#!/usr/bin/env bash
2
3set -euo pipefail
4
5resolve_bun_bin() {
6 if command -v bun >/dev/null 2>&1; then
7 command -v bun
8 return 0
9 fi
10
11 if [[ -x "${HOME}/.bun/bin/bun" ]]; then
12 printf '%s\n' "${HOME}/.bun/bin/bun"
13 return 0
14 fi
15
16 return 1
17}
18
19install_latest_bun() {
20 if command -v curl >/dev/null 2>&1; then
21 curl -fsSL https://bun.sh/install | bash >/dev/null
22 return 0
23 fi
24
25 if command -v wget >/dev/null 2>&1; then
26 wget -qO- https://bun.sh/install | bash >/dev/null
27 return 0
28 fi
29
30 echo "❌ Bun is required, and curl/wget is unavailable for auto-install."
31 echo " Install Bun manually: https://bun.com/docs/installation"
32 exit 1
33}
34
35BUN_BIN="$(resolve_bun_bin || true)"
36
37if [[ -z "$BUN_BIN" || ! -x "$BUN_BIN" ]]; then
38 echo "📦 Bun not found. Installing latest Bun..."
39 install_latest_bun
40 BUN_BIN="$(resolve_bun_bin || true)"
41fi
42
43if [[ -z "$BUN_BIN" || ! -x "$BUN_BIN" ]]; then
44 echo "❌ Bun could not be resolved after install."
45 echo " Install Bun manually: https://bun.com/docs/installation"
46 exit 1
47fi
48
49if ! "$BUN_BIN" upgrade >/dev/null 2>&1; then
50 echo "⚠️ Bun auto-upgrade failed. Reinstalling latest Bun..."
51 install_latest_bun
52 BUN_BIN="$(resolve_bun_bin || true)"
53fi
54
55if [[ -z "$BUN_BIN" || ! -x "$BUN_BIN" ]]; then
56 echo "❌ Bun could not be resolved after auto-upgrade."
57 echo " Install Bun manually: https://bun.com/docs/installation"
58 exit 1
59fi
60
61bun_major="$($BUN_BIN --version | awk -F. '{print $1}' 2>/dev/null || echo 0)"
62if [[ "$bun_major" -lt 1 ]]; then
63 echo "❌ Bun 1.x+ is required. Current: $($BUN_BIN --version 2>/dev/null || echo 'unknown')"
64 exit 1
65fi
66
67echo "✅ Bun $($BUN_BIN --version) ready"