Select the types of activity you want to include in your feed.
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.
···42424343```bash
4444docker logs -f tweets-2-bsky
4545-docker exec -it tweets-2-bsky node dist/cli.js status
4545+docker exec -it tweets-2-bsky bun dist/cli.js status
4646docker stop tweets-2-bsky
4747docker start tweets-2-bsky
4848```
···83838484What this does by default:
85858686+- auto-installs Bun (latest stable for your platform) when missing
8787+- auto-upgrades Bun to latest stable before install/build
8688- installs dependencies
8789- builds server + web dashboard
8890- creates/updates `.env` with sensible defaults (`PORT=3000`, generated `JWT_SECRET` if missing)
···190192You can run CLI commands without leaving Docker:
191193192194```bash
193193-docker exec -it tweets-2-bsky node dist/cli.js status
194194-docker exec -it tweets-2-bsky node dist/cli.js run-now
195195-docker exec -it tweets-2-bsky node dist/cli.js list
195195+docker exec -it tweets-2-bsky bun dist/cli.js status
196196+docker exec -it tweets-2-bsky bun dist/cli.js run-now
197197+docker exec -it tweets-2-bsky bun dist/cli.js list
196198```
197199198200### 6) Updating Docker deployments
···338340339341If running from source instead of Docker:
340342341341-- Node.js 22+
342342-- npm
343343+- Bun 1.x+ (auto-installed/upgraded by `install.sh` and `update.sh`)
343344- git
344345345346Optional but recommended for source installs:
···355356```bash
356357git clone https://github.com/j4ckxyz/tweets-2-bsky
357358cd tweets-2-bsky
358358-npm install
359359-npm run build
360360-npm start
359359+bun install
360360+bun run build
361361+bun run start
361362```
362363363364Open: [http://localhost:3000](http://localhost:3000)
···376377EOF
377378```
378379379379-### Rebuild native modules after Node version changes
380380+### Rebuild native modules
380381381382```bash
382382-npm run rebuild:native
383383-npm run build
383383+bun run rebuild:native
384384+bun run build
384385```
385386386387## First-Time Setup via CLI (Alternative to Web Forms)
387388388389```bash
389389-npm run cli -- setup-twitter
390390-npm run cli -- add-mapping
391391-npm run cli -- run-now
390390+bun run cli -- setup-twitter
391391+bun run cli -- add-mapping
392392+bun run cli -- run-now
392393```
393394394395`add-mapping` now runs a guided onboarding flow:
···403404Always invoke CLI commands as:
404405405406```bash
406406-npm run cli -- <command>
407407+bun run cli -- <command>
407408```
408409409410### Status and basic operations
410411411412```bash
412412-npm run cli -- status
413413-npm run cli -- list
414414-npm run cli -- recent-activity --limit 20
413413+bun run cli -- status
414414+bun run cli -- list
415415+bun run cli -- recent-activity --limit 20
415416```
416417417418### Credentials and configuration
418419419420```bash
420420-npm run cli -- setup-twitter
421421-npm run cli -- setup-ai
422422-npm run cli -- set-interval 5
421421+bun run cli -- setup-twitter
422422+bun run cli -- setup-ai
423423+bun run cli -- set-interval 5
423424```
424425425426### Mapping management
426427427428```bash
428428-npm run cli -- add-mapping
429429-npm run cli -- sync-profile <mapping-id-or-handle> --source <twitter-username>
430430-npm run cli -- edit-mapping <mapping-id-or-handle>
431431-npm run cli -- remove <mapping-id-or-handle>
429429+bun run cli -- add-mapping
430430+bun run cli -- sync-profile <mapping-id-or-handle> --source <twitter-username>
431431+bun run cli -- edit-mapping <mapping-id-or-handle>
432432+bun run cli -- remove <mapping-id-or-handle>
432433```
433434434435### Running syncs
435436436437```bash
437437-npm run cli -- run-now
438438-npm run cli -- run-now --dry-run
439439-npm run cli -- run-now --web
438438+bun run cli -- run-now
439439+bun run cli -- run-now --dry-run
440440+bun run cli -- run-now --web
440441```
441442442443### Backfill and history import
443444444445```bash
445445-npm run cli -- backfill <mapping-id-or-handle> --limit 50
446446-npm run cli -- import-history <mapping-id-or-handle> --limit 100
447447-npm run cli -- clear-cache <mapping-id-or-handle>
446446+bun run cli -- backfill <mapping-id-or-handle> --limit 50
447447+bun run cli -- import-history <mapping-id-or-handle> --limit 100
448448+bun run cli -- clear-cache <mapping-id-or-handle>
448449```
449450450451### Dangerous operation (admin workflow)
451452452453```bash
453453-npm run cli -- delete-all-posts <mapping-id-or-handle>
454454+bun run cli -- delete-all-posts <mapping-id-or-handle>
454455```
455456456457### Config export/import
457458458459```bash
459459-npm run cli -- config-export ./tweets-2-bsky-config.json
460460-npm run cli -- config-import ./tweets-2-bsky-config.json
460460+bun run cli -- config-export ./tweets-2-bsky-config.json
461461+bun run cli -- config-import ./tweets-2-bsky-config.json
461462```
462463463464Mapping references accept:
···471472Run every 5 minutes:
472473473474```cron
474474-*/5 * * * * cd /path/to/tweets-2-bsky && /usr/bin/npm run cli -- run-now >> /tmp/tweets-2-bsky.log 2>&1
475475+*/5 * * * * cd /path/to/tweets-2-bsky && /usr/local/bin/bun run cli -- run-now >> /tmp/tweets-2-bsky.log 2>&1
475476```
476477477478Run one backfill once:
478479479480```bash
480480-npm run cli -- backfill <mapping-id-or-handle> --limit 50
481481+bun run cli -- backfill <mapping-id-or-handle> --limit 50
481482```
482483483484## Background Runtime Options
···493494### Option B: manage PM2 directly
494495495496```bash
496496-pm2 start dist/index.js --name tweets-2-bsky
497497+pm2 start dist/index.js --name tweets-2-bsky --interpreter bun
497498pm2 logs tweets-2-bsky
498499pm2 restart tweets-2-bsky --update-env
499500pm2 save
···503504504505```bash
505506mkdir -p data/runtime
506506-nohup npm start > data/runtime/tweets-2-bsky.log 2>&1 &
507507+nohup bun run start > data/runtime/tweets-2-bsky.log 2>&1 &
507508echo $! > data/runtime/tweets-2-bsky.pid
508509```
509510···525526526527- stashes local uncommitted changes before pull and restores them after update
527528- pulls latest code (supports non-`origin` remotes and detached-head recovery)
529529+- ensures Bun is installed and upgraded to latest stable
528530- installs dependencies
529529-- rebuilds native modules when Node ABI changed
531531+- rebuilds native modules when runtime/dependencies changed
530532- builds server + web dashboard
531533- restarts existing runtime for PM2 **or** nohup mode
532534- preserves local `config.json` and `.env` with backup/restore
···584586### Start backend/scheduler from source
585587586588```bash
587587-npm run dev
589589+bun run dev
588590```
589591590592### Start Vite web dev server
591593592594```bash
593593-npm run dev:web
595595+bun run dev:web
594596```
595597596598### Build and quality checks
597599598600```bash
599599-npm run build
600600-npm run typecheck
601601-npm run lint
601601+bun run build
602602+bun run typecheck
603603+bun run lint
602604```
603605604606## Troubleshooting
605607606608See: `TROUBLESHOOTING.md`
607609608608-Common recovery after changing Node versions:
610610+Common recovery when native modules fail to load:
609611610612```bash
611611-npm run rebuild:native
612612-npm run build
613613-npm start
613613+bun run rebuild:native
614614+bun run build
615615+bun run start
614616```
615617616618## License
+23-13
TROUBLESHOOTING.md
···1616 ./update.sh
1717 ```
18181919-### PM2 "MODULE_NOT_FOUND" Error
2020-If you see errors about `npm` not being found in the logs after an update:
1919+### PM2 interpreter mismatch
2020+If PM2 logs show command/runtime errors after an update (for example old `npm`/`node` interpreter paths):
212122221. Run the repair script:
2323 ```bash
2424 chmod +x repair_pm2.sh
2525- ./repair_pm2.sh
2525+ ./repair_pm2.sh
2626+ ```
2727+2828+### `bun: command not found`
2929+If Bun is missing on a source install host:
3030+3131+1. Run either installer/updater once (they auto-install and auto-upgrade Bun to latest stable):
3232+ ```bash
3333+ ./install.sh --no-start
3434+ # or
3535+ ./update.sh --no-restart
2636 ```
27372828-### `better-sqlite3` NODE_MODULE_VERSION mismatch
2929-If startup fails with `ERR_DLOPEN_FAILED` and a `NODE_MODULE_VERSION` mismatch:
3838+### Native module load failure (`ERR_DLOPEN_FAILED`)
3939+If startup fails while loading native dependencies:
30403131-1. Rebuild native bindings for your active Node version:
4141+1. Reinstall/rebuild native dependencies with Bun:
3242 ```bash
3333- npm run rebuild:native
4343+ bun run rebuild:native
3444 ```
35452. Rebuild and start:
3646 ```bash
3737- npm run build
3838- npm start
4747+ bun run build
4848+ bun run start
3949 ```
40504151### Dashboard appears unstyled / plain text UI
···435344541. Rebuild web assets:
4555 ```bash
4646- npm run build
5656+ bun run build
4757 ```
48582. Restart server:
4959 ```bash
5050- npm start
6060+ bun run start
5161 ```
52623. Hard refresh browser cache (`Cmd+Shift+R` on macOS).
53635464### CLI command not recognized
5555-When using npm scripts, pass CLI args after `--`:
6565+When using Bun scripts, pass CLI args after `--`:
56665767```bash
5858-npm run cli -- status
6868+bun run cli -- status
5969```
60706171### Docker: permissions writing `/app/data`