{"id":48963793,"url":"https://github.com/paperfoot/xmaster-cli","last_synced_at":"2026-05-02T18:04:51.971Z","repository":{"id":346274686,"uuid":"1189170432","full_name":"paperfoot/xmaster-cli","owner":"paperfoot","description":"X/Twitter CLI for developers and AI agents — post, reply, search, DM, schedule, analyze. Single Rust binary.","archived":false,"fork":false,"pushed_at":"2026-04-17T20:43:19.000Z","size":1690,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-17T22:13:54.415Z","etag":null,"topics":["ai-agent","ai-agent-tools","automation","cli","command-line-tool","developer-tools","rust","rust-cli","social-media","social-media-cli","tweet-automation","twitter","twitter-api","twitter-bot","twitter-posting","twitter-search","x-api","x-automation","x-cli","x-posting-tool"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paperfoot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-23T03:35:51.000Z","updated_at":"2026-04-17T20:43:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/paperfoot/xmaster-cli","commit_stats":null,"previous_names":["199-biotechnologies/xmaster","paperfoot/xmaster"],"tags_count":37,"template":false,"template_full_name":null,"purl":"pkg:github/paperfoot/xmaster-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paperfoot%2Fxmaster-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paperfoot%2Fxmaster-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paperfoot%2Fxmaster-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paperfoot%2Fxmaster-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paperfoot","download_url":"https://codeload.github.com/paperfoot/xmaster-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paperfoot%2Fxmaster-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31954738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agent","ai-agent-tools","automation","cli","command-line-tool","developer-tools","rust","rust-cli","social-media","social-media-cli","tweet-automation","twitter","twitter-api","twitter-bot","twitter-posting","twitter-search","x-api","x-automation","x-cli","x-posting-tool"],"created_at":"2026-04-18T03:04:12.468Z","updated_at":"2026-05-02T18:04:51.946Z","avatar_url":"https://github.com/paperfoot.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# XMaster\n\n**The X/Twitter CLI for developers and AI agents**\n\n\u003cbr /\u003e\n\n[![Star this repo](https://img.shields.io/github/stars/paperfoot/xmaster-cli?style=for-the-badge\u0026logo=github\u0026label=%E2%AD%90%20Star%20this%20repo\u0026color=yellow)](https://github.com/paperfoot/xmaster-cli/stargazers)\n\u0026nbsp;\u0026nbsp;\n[![Follow @longevityboris](https://img.shields.io/badge/Follow_%40longevityboris-000000?style=for-the-badge\u0026logo=x\u0026logoColor=white)](https://x.com/longevityboris)\n\n\u003cbr /\u003e\n\n[![Crates.io](https://img.shields.io/crates/v/xmaster?style=for-the-badge\u0026logo=rust\u0026logoColor=white\u0026label=crates.io)](https://crates.io/crates/xmaster)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue?style=for-the-badge)](https://github.com/paperfoot/xmaster-cli/blob/main/LICENSE)\n[![Homebrew](https://img.shields.io/badge/Homebrew-available-orange?style=for-the-badge\u0026logo=homebrew\u0026logoColor=white)](https://github.com/199-biotechnologies/homebrew-tap)\n[![Built with Rust](https://img.shields.io/badge/Built_with-Rust-dea584?style=for-the-badge\u0026logo=rust\u0026logoColor=white)](https://www.rust-lang.org/)\n\n---\n\nPost, reply, like, retweet, DM, search, schedule, and analyze -- all from your terminal. XMaster is a single Rust binary that wraps the X API v2, xAI/Grok search, and a web session fallback into one tool. It outputs structured JSON for AI agents and readable tables for humans.\n\n[Install](#install) | [How It Works](#how-it-works) | [Commands](#commands) | [Contributing](#contributing)\n\n\u003c/div\u003e\n\n## Why This Exists\n\nI wanted my AI agents to handle X for me. Find posts in my niche, draft replies in my voice, track what works. Not for spamming -- just a less tedious way to stay engaged when I'd rather be building things.\n\nMost X tools make you pick between the official API and scraping. XMaster gives you both, plus the parts nobody else builds: pre-flight post analysis, engagement scoring, reply bypass, local scheduling, and a bookmarks archive that survives tweet deletions.\n\n## Install\n\n**One-liner (macOS / Linux):**\n```bash\ncurl -fsSL https://raw.githubusercontent.com/paperfoot/xmaster-cli/master/install.sh | sh\n```\n\n**Homebrew:**\n```bash\nbrew tap 199-biotechnologies/tap\nbrew install xmaster\n```\n\n**Cargo (crates.io):**\n```bash\ncargo install xmaster\n```\n\n**From source:**\n```bash\ncargo install --git https://github.com/paperfoot/xmaster-cli\n```\n\n### Quick Start\n\n```bash\n# 1. Get your X API keys from https://developer.x.com\n\n# 2. Configure credentials\nxmaster config set keys.api_key YOUR_API_KEY\nxmaster config set keys.api_secret YOUR_API_SECRET\nxmaster config set keys.access_token YOUR_ACCESS_TOKEN\nxmaster config set keys.access_token_secret YOUR_ACCESS_TOKEN_SECRET\n\n# 3. Verify setup\nxmaster config check\n\n# 4. Post\nxmaster post \"Hello from xmaster\"\n```\n\nOptional extras:\n```bash\nxmaster config set keys.xai YOUR_XAI_KEY          # AI-powered search via xAI/Grok\nxmaster config web-login                           # Enable reply bypass (auto-captures browser cookies)\nxmaster config set style.voice \"your style here\"   # Agents write in your voice\nxmaster config set account.premium true            # 25k char limit instead of 280\n```\n\n## How It Works\n\nXMaster has three backends behind one CLI:\n\n| Backend | Auth | Used for |\n|---------|------|----------|\n| **X API v2** | OAuth 1.0a | Posting, likes, retweets, DMs, search, timelines, follows |\n| **xAI / Grok** | Bearer token | AI-powered semantic search, trending topics |\n| **Web GraphQL** | Browser cookies | Reply bypass when X blocks API replies to strangers |\n\nEvery command returns JSON when piped (or with `--json`). Exit codes are semantic: 0 success, 1 runtime error, 2 config error, 3 auth missing, 4 rate limited. Your agent always knows what happened.\n\n```\n┌─────────────────────────────────────────────┐\n│                 CLI Layer                    │\n│   clap + comfy-table (--json / human)       │\n├─────────────────────────────────────────────┤\n│          Command Router + Pre-flight        │\n│   Analyze, score, cannibalization guard     │\n├──────────┬──────────────┬───────────────────┤\n│ X API v2 │  xAI / Grok  │  Web GraphQL      │\n│(OAuth1.0a│(Bearer token)│  (Cookie auth +   │\n│ Post,Like│ AI search,   │   transaction ID) │\n│ RT, DM,  │ Trending,    │  Reply fallback   │\n│ Search,  │ Semantic     │  when API blocks  │\n│ Timeline)│ search       │  replies          │\n├──────────┴──────────────┴───────────────────┤\n│  Rate Limiter │ Intel Store │ Scheduler     │\n│  (header-based)│  (SQLite)  │  (launchd)    │\n├─────────────────────────────────────────────┤\n│             Config (figment)                │\n│   TOML + env vars + browser cookies         │\n└─────────────────────────────────────────────┘\n```\n\n## Commands\n\n### Posting and Engagement\n\n| Command | What it does | Example |\n|---------|-------------|---------|\n| `post` | Post text, media, replies, quotes, polls | `xmaster post \"Hello world\"` |\n| `reply` | Reply to a post (auto-bypasses API restrictions) | `xmaster reply 1234567890 \"Great point\"` |\n| `thread` | Post a multi-tweet thread | `xmaster thread \"First\" \"Second\" \"Third\"` |\n| `article preview` | Generate an X Articles-style HTML preview from Markdown | `xmaster article preview draft.md --header-image cover.png -o preview.html` |\n| `article draft` | Save a native X Article draft without publishing | `xmaster article draft draft.md --header-image cover.png` |\n| `delete` | Delete a post | `xmaster delete 1234567890` |\n| `like` | Like a tweet (ID or URL) | `xmaster like 1234567890` |\n| `unlike` | Unlike a tweet | `xmaster unlike 1234567890` |\n| `retweet` | Retweet a tweet | `xmaster retweet 1234567890` |\n| `unretweet` | Undo a retweet | `xmaster unretweet 1234567890` |\n| `bookmark` | Bookmark a tweet | `xmaster bookmark 1234567890` |\n| `unbookmark` | Remove a bookmark | `xmaster unbookmark 1234567890` |\n\nPost options:\n```bash\nxmaster post \"Great point!\" --reply-to 1234567890      # Reply\nxmaster post \"This is big\" --quote 1234567890           # Quote tweet\nxmaster post \"Check this\" --media photo.jpg             # Attach media (up to 4)\nxmaster post \"Best language?\" --poll \"Rust,Go,Python\"   # Create a poll\nxmaster like https://x.com/user/status/1234567890       # URLs work too\n```\n\n`article preview` and `article draft` are for X Articles, not long posts / Note Tweets. Drafts use Markdown and map to the native Article surface: `#` title, `##`/`###` headings, `**bold**`, `*italic*`, `~~strikethrough~~`, indentation/quotes, numbered/bulleted lists, links, images, video/GIF directives, and embedded X posts. Use `::video[Caption](clip.mp4)`, `::gif[Caption](loop.gif)`, `::post(https://x.com/user/status/123)`, or `::article(https://x.com/i/article/123)` for media and embeds that Markdown does not model directly. Native draft creation uses X's private web Article entity endpoint (`ArticleEntityDraftCreate`) with browser cookies from `xmaster config web-login`; it saves a draft and does not publish.\n\n### Reading and Discovery\n\n| Command | What it does | Example |\n|---------|-------------|---------|\n| `read` | Full post lookup (text, author, metrics, media) | `xmaster read 1234567890` |\n| `replies` | Get replies on a post | `xmaster replies 1234567890 -c 30` |\n| `metrics` | Detailed engagement metrics | `xmaster metrics 1234567890` |\n| `timeline` | Home or user timeline | `xmaster timeline --user elonmusk --since 24h` |\n| `mentions` | Your mentions | `xmaster mentions -c 20` |\n| `user` | User profile info | `xmaster user elonmusk` |\n| `me` | Your own profile | `xmaster me` |\n\n### Search\n\n| Command | What it does | Example |\n|---------|-------------|---------|\n| `search` | X API v2 search (structured, filterable) | `xmaster search \"rust lang\" --mode recent` |\n| `search-ai` | AI-powered search via xAI/Grok | `xmaster search-ai \"latest AI news\"` |\n| `trending` | Trending topics by region | `xmaster trending --region US` |\n\n### Social Graph\n\n| Command | What it does | Example |\n|---------|-------------|---------|\n| `follow` | Follow a user | `xmaster follow elonmusk` |\n| `unfollow` | Unfollow a user | `xmaster unfollow elonmusk` |\n| `followers` | List followers | `xmaster followers elonmusk -c 50` |\n| `following` | List who a user follows | `xmaster following elonmusk -c 50` |\n\n### Direct Messages\n\n| Command | What it does | Example |\n|---------|-------------|---------|\n| `dm send` | Send a DM | `xmaster dm send alice \"Hey!\"` |\n| `dm inbox` | View DM inbox | `xmaster dm inbox -c 20` |\n| `dm thread` | View a DM conversation | `xmaster dm thread CONV_ID` |\n\n### Scheduling\n\n| Command | What it does | Example |\n|---------|-------------|---------|\n| `schedule add` | Schedule a post for later | `xmaster schedule add \"text\" --at \"2026-03-24 09:00\"` |\n| `schedule add --at auto` | Auto-pick best posting time | `xmaster schedule add \"text\" --at auto` |\n| `schedule list` | List scheduled posts | `xmaster schedule list --status pending` |\n| `schedule cancel` | Cancel a scheduled post | `xmaster schedule cancel sched_abc123` |\n| `schedule fire` | Execute due posts (for cron) | `xmaster schedule fire` |\n| `schedule setup` | Install launchd auto-scheduler | `xmaster schedule setup` |\n\nPosts are stored in local SQLite. No X Ads API needed. The launchd daemon fires every 5 minutes on macOS. Use `--at auto` to pick the best time from your engagement history.\n\n### Bookmark Intelligence\n\n| Command | What it does | Example |\n|---------|-------------|---------|\n| `bookmarks list` | List recent bookmarks | `xmaster bookmarks list -c 20` |\n| `bookmarks sync` | Archive bookmarks locally (survives deletions) | `xmaster bookmarks sync -c 200` |\n| `bookmarks search` | Search your archive | `xmaster bookmarks search \"longevity\"` |\n| `bookmarks export` | Export as markdown | `xmaster bookmarks export -o bookmarks.md` |\n| `bookmarks digest` | Weekly summary | `xmaster bookmarks digest -d 7` |\n\n`bookmarks sync` archives content in SQLite. If the original tweet gets deleted, your copy survives.\n\n### Engagement Intelligence\n\n| Command | What it does | Example |\n|---------|-------------|---------|\n| `engage recommend` | Find high-ROI reply targets | `xmaster engage recommend --topic \"AI\" -c 10` |\n| `engage feed` | Fresh posts from large accounts | `xmaster engage feed \"AI agents\" --min-followers 5000` |\n| `engage watchlist add` | Track accounts without following | `xmaster engage watchlist add elonmusk` |\n| `engage watchlist list` | List watched accounts | `xmaster engage watchlist list` |\n\nThe opportunity scorer ranks targets by reciprocity, reply ROI, size fit (adaptive to your follower count), topicality, and freshness.\n\n### Pre-Flight Analysis\n\n| Command | What it does | Example |\n|---------|-------------|---------|\n| `analyze` | Score a post before publishing | `xmaster analyze \"your text\" --goal replies` |\n| `suggest best-time` | Best posting time from history | `xmaster suggest best-time` |\n| `suggest next-post` | Cannibalization guard | `xmaster suggest next-post` |\n| `report daily` | Daily performance digest | `xmaster report daily` |\n| `report weekly` | Weekly performance digest | `xmaster report weekly` |\n| `track run` | Snapshot recent post metrics | `xmaster track run` |\n| `track followers` | Track follower changes | `xmaster track followers` |\n| `track growth` | Follower growth history | `xmaster track growth -d 30` |\n| `inspire` | Browse your discovered posts library | `xmaster inspire --topic \"longevity\"` |\n| `inspire --long` | Surface long-form / Article-candidate exemplars (\u003e=500 chars) | `xmaster inspire --long --topic \"biotech\"` |\n\n`analyze` estimates 9 proxy signals aligned with the 2026 X algorithm and scores per goal (replies, quotes, shares, follows, impressions). For drafts above 500 chars it also runs **long-form heuristics** (preview-card hook on the first 280 chars, scannability, payoff density, dwell sweet-spot 500–2000 chars) — informed by the Jan 2026 $1M Article Contest results. Run `xmaster agent-info` for the full long-form pattern set including timing, structure, and a `nanaban` pointer for cover-image generation.\n\n### Lists\n\n| Command | What it does | Example |\n|---------|-------------|---------|\n| `lists create` | Create a list | `xmaster lists create \"AI Builders\"` |\n| `lists add` | Add user to a list | `xmaster lists add LIST_ID username` |\n| `lists timeline` | View a list timeline | `xmaster lists timeline LIST_ID` |\n| `lists mine` | View your lists | `xmaster lists mine` |\n\n### Moderation\n\n| Command | What it does | Example |\n|---------|-------------|---------|\n| `block` / `unblock` | Block or unblock a user | `xmaster block spammer123` |\n| `mute` / `unmute` | Mute or unmute a user | `xmaster mute username` |\n| `hide-reply` / `unhide-reply` | Hide replies on your posts | `xmaster hide-reply 1234567890` |\n\n### System\n\n| Command | What it does | Example |\n|---------|-------------|---------|\n| `config show` | View config (keys masked) | `xmaster config show` |\n| `config check` | Validate credentials | `xmaster config check` |\n| `config web-login` | Capture browser cookies for reply bypass | `xmaster config web-login` |\n| `agent-info` | Machine-readable capabilities for AI agents | `xmaster agent-info --json` |\n| `rate-limits` | Check API quota status | `xmaster rate-limits` |\n| `update` | Self-update from GitHub releases | `xmaster update` |\n\n## For AI Agents\n\nXMaster is built for AI agents from day one. Every command supports `--json` and returns structured envelopes with semantic exit codes.\n\n```bash\n# JSON output (auto-enabled when piped)\nxmaster --json post \"Hello from my agent\"\nxmaster post \"Hello\" | jq '.data.id'\n```\n\n**Response envelope:**\n```json\n{\n  \"version\": \"1\",\n  \"status\": \"success\",\n  \"data\": { \"...\" },\n  \"metadata\": {\n    \"elapsed_ms\": 342,\n    \"provider\": \"x_api\"\n  }\n}\n```\n\n**Exit codes:** 0 = success, 1 = runtime error, 2 = config error, 3 = auth missing, 4 = rate limited.\n\n**Agent discovery:**\n```bash\nxmaster agent-info --json\n# Returns: 64 commands, 18 capabilities, 15 algorithm weights,\n# measurement coverage, workflow handoffs, writing style config\n```\n\n**Pre-flight analysis:**\n```bash\nxmaster analyze \"your tweet\" --goal replies --json\n# Returns per-signal scores and per-goal scores (0-100)\n```\n\n**Works with:** [Claude Code](https://github.com/anthropics/claude-code), [OpenClaw](https://github.com/openclaw/openclaw), or any agent that can shell out and parse JSON.\n\n## Configuration\n\nConfig lives at `~/.config/xmaster/config.toml` on all platforms. Override with `XMASTER_CONFIG_DIR`.\n\n```bash\nxmaster config show       # View current config (keys masked)\nxmaster config check      # Validate credentials\nxmaster config set K V    # Set a value\nxmaster config get K      # Read a value\n```\n\n**Environment variables** override the config file. Use `XMASTER_` prefix with double underscore for nesting:\n\n```bash\nexport XMASTER_KEYS__API_KEY=your-api-key\nexport XMASTER_KEYS__API_SECRET=your-api-secret\nexport XMASTER_KEYS__ACCESS_TOKEN=your-access-token\nexport XMASTER_KEYS__ACCESS_TOKEN_SECRET=your-access-token-secret\nexport XMASTER_KEYS__XAI=your-xai-key\n```\n\n## Building from Source\n\n```bash\ngit clone https://github.com/paperfoot/xmaster-cli\ncd xmaster\ncargo build --release\n# Binary at target/release/xmaster\n```\n\n## Contributing\n\nContributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n## License\n\n[MIT](LICENSE)\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\nBuilt by [Boris Djordjevic](https://github.com/longevityboris) at [199 Biotechnologies](https://github.com/199-biotechnologies) | [Paperfoot AI](https://paperfoot.ai)\n\n\u003cbr /\u003e\n\n**If this is useful to you:**\n\n[![Star this repo](https://img.shields.io/github/stars/paperfoot/xmaster-cli?style=for-the-badge\u0026logo=github\u0026label=%E2%AD%90%20Star%20this%20repo\u0026color=yellow)](https://github.com/paperfoot/xmaster-cli/stargazers)\n\u0026nbsp;\u0026nbsp;\n[![Follow @longevityboris](https://img.shields.io/badge/Follow_%40longevityboris-000000?style=for-the-badge\u0026logo=x\u0026logoColor=white)](https://x.com/longevityboris)\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaperfoot%2Fxmaster-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaperfoot%2Fxmaster-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaperfoot%2Fxmaster-cli/lists"}