x2masto
v0.2.0
Published
Collect X following data and generate Mastodon import candidates
Maintainers
Readme
x2masto
Collect your X/Twitter following data and build Mastodon import CSVs.
x2masto is a Node.js CLI toolkit that helps you:
- browse your following list on X while a helper script reads visible profile cards,
- extract likely Mastodon handles from profile text/links,
- optionally run a second Mastodon search pass to discover more matches.
Why this project exists
X and Mastodon don't offer a direct follow migration path. This toolchain builds one from your own follow graph data.
How it works
The collect step does not automate scrolling or navigation. You browse your own following list manually in Chrome while the script passively reads whatever profile cards are currently visible on screen — like a clipboard that remembers what you've seen. You control the pace; the script just takes notes.
Install
As an npm package
npm install -g x2mastoQuickstart
1) Start Chrome with remote debugging
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
--remote-debugging-port=9222 \
--user-data-dir="$HOME/.cache/browser-tools" \
--no-first-run \
--no-default-browser-checkLog into x.com in that Chrome window.
2) Collect your X following dataset
npm run collect:x-following -- --user <username>The script opens your /following page and waits. Scroll through the list
yourself at whatever pace you like. The script reads visible profile cards as
you go. Press Enter in the terminal when you're done.
Output files:
data/x-following-raw.csvdata/x-following-raw.jsonl
3) Extract Mastodon handles
npm run match:mastodonOutput files:
data/x-matches.csvdata/x-mastodon-import.csv
Optional handle verification via WebFinger:
npm run match:mastodon -- --verify --verify-workers 84) Optional: search Mastodon instances for additional matches
npm run search:mastodon -- --max-accounts 500Output files:
data/x-search-matches.csvdata/x-mastodon-import-search.csvdata/x-mastodon-import-combined.csv
CLI commands
If installed globally from npm, you can use:
x2masto-collectx2masto-matchx2masto-search
Or keep using npm scripts from source:
npm run collect:x-following -- ...npm run match:mastodon -- ...npm run search:mastodon -- ...
Development
npm ci
npm run check
npm pack --dry-runContributing & community
Notes
- X UI and anti-bot behavior can change; selectors may need updates.
- Login/CAPTCHA/MFA are intentionally manual; the collect step only reads visible data.
- Handle extraction is heuristic. Review generated CSVs before importing.
