| name | xactions-cli |
| description | Command-line interface for scraping X/Twitter data, managing MCP server config, and running automation. Scrapes profiles, followers, tweets, search results, and more from terminal. Outputs text, JSON, or CSV. Uses Puppeteer stealth. Use when running Twitter operations from command line or automated pipelines. |
| license | MIT |
| compatibility | Requires Node.js 18+. Install with npm install -g xactions. |
| metadata | {"author":"nichxbt","version":"4.0"} |
XActions CLI
Entry point: src/cli/index.js. Config stored at ~/.xactions/config.json.
Installation
npm install -g xactions
Authentication
xactions login
xactions logout
xactions info
Get your auth_token: DevTools (F12) -> Application -> Cookies -> x.com -> copy auth_token value.
Scraping Commands
xactions profile <username>
xactions followers <username> [-l <limit>] [-o json|csv]
xactions following <username> [-l <limit>] [-o json|csv]
xactions non-followers <username>
xactions tweets <username> [-l <limit>] [-o json|csv]
xactions search "<query>" [-l <limit>] [-o json|csv]
xactions hashtag <tag> [-l <limit>] [-o json|csv]
xactions thread <url>
xactions media <username> [-l <limit>]
MCP Server Commands
xactions mcp-config
xactions mcp-config --client cursor
xactions mcp-config --client windsurf
xactions mcp-config --client vscode
xactions mcp-config --write
The mcp-config command auto-detects your OS and generates the correct config file path.
Output Flags
| Flag | Description |
|---|
-l, --limit <n> | Maximum items to scrape |
-o, --output <format> | json or csv — saves to {username}_{command}.{ext} |
Default output is pretty-printed to terminal with colored formatting.
Programmatic API
The CLI wraps the same scraper API available as a library:
import { createBrowser, createPage, loginWithCookie,
scrapeProfile, scrapeFollowers, scrapeFollowing, scrapeTweets,
searchTweets, scrapeHashtag, scrapeThread, scrapeMedia,
exportToJSON, exportToCSV } from 'xactions';
Examples
xactions profile elonmusk
xactions followers nichxbt -l 200 -o csv
xactions search "AI agents" -l 50 -o json
xactions thread https://x.com/nichxbt/status/1234567890
xactions mcp-config --write
Troubleshooting
| Problem | Solution |
|---|
| "Not authenticated" | Run xactions login first |
| Browser won't launch | Install Chromium: npx puppeteer browsers install chrome |
| Scraping returns empty | Account may be private or auth_token expired |
| Command not found | Reinstall: npm install -g xactions |
| MCP config path wrong | Use --client flag to specify your IDE |
Related Skills
- twitter-scraping — Detailed scraper API documentation
- xactions-mcp-server — MCP server setup and tools