# x-api CLI `x-api` is the only current CLI binary. ## Build ```bash cargo build -p x-api-cli --all-features --bin x-api cargo test -p x-api-cli --all-features ``` ## Command Families - `dm`: `send`, `send-batch`; both support `--api-version v1|v2` and default to `v2`. - `upload`: `image`, `multiple`. - `inbox`: `updates`, `conversations`, `count`. - `user`: profile lookup/editing, image/banner changes, followers/following, follow/unfollow, block/unblock, list helpers. - `posts`: create/delete/like/unlike/retweet/unretweet, `get-tweets`, `get-likes`, `clear-bookmarks`, `check-status`(只读判发帖能力,输出 status/writable)。`retweet`/`unretweet` 业务成败在 envelope `data.success`(外层 success 仅表示客户端 Ok);`unretweet --id` 传原帖 ID;`data` 字段见 `docs/cli/posts.md`(RetweetResult / DeleteTweetResult)。 - `communities`: `search`, `join`. - `settings`: account/privacy/safety settings commands. - `search`: `top`, `latest`, `people`, `media`, `lists`. - `xchat`: enrollment, status, sending, receiving, PIN recovery flows. - `raw`: authenticated raw HTTP helpers. - `auth`: `token-to-cookies --token [--proxy ] --allow-plaintext-secrets` — exchange a single auth_token for full cookies. Runs without `--cookies-file` (no existing cookies needed); output `data` carries `cookies`/`ct0`/`user_id`/`auth_token`. All command output is JSON/JSONL on stdout; logs belong on stderr.