X CLI
Use this skill to operate x-cli safely and consistently.
Use This Skill For
- Logging into X through the browser-based auth flow
- Fetching home timelines, user timelines, tweets, user profiles, search results, followers, or following lists
- Using
--json output for downstream parsing or automation
- Diagnosing auth failures, rate limits, pagination, or GraphQL query ID rotation
- Updating or validating the CLI's endpoint/query ID registry when X changes its internal API
Core Rules
- Prefer
x-cli over ad hoc curl requests to X when the CLI surface already covers the task.
- Prefer
--json when another tool, agent, or script will consume the output.
- Treat
~/.x-cli/credentials.json as managed state. Use x-cli auth login, status, and logout instead of editing it manually.
- Use
tweet get with either a tweet ID or full X URL.
- Expect cursor-based pagination on list commands and preserve returned cursors when continuing a session.
- If multiple commands start returning
404 responses, suspect GraphQL query ID drift in internal/api/endpoints.go.
Quick Workflow
- Verify the binary and auth state.
- Authenticate if needed.
- Run the smallest command that answers the task.
- Switch to
--json for parsing or handoff.
- Follow pagination cursors or
--all only when the user wants broader retrieval.
- Use
--verbose when debugging HTTP failures or endpoint drift.
Prerequisites
x-cli available on PATH, or use the repo-local binary.
- Google Chrome installed for browser-based login.
- A valid X account session.
For repo-local build and install commands, see references/install-and-build.md.
Standard Command Path
For a typical session:
x-cli auth status
x-cli auth login
x-cli timeline home --count 20
x-cli tweet get https://x.com/jack/status/20 --json
x-cli user get @jack
x-cli search "golang" --type latest --json
For follower graph inspection:
x-cli followers @jack --count 50
x-cli following @jack --count 50 --json
Load references/command-map.md when you need exact command shapes, pagination flags, or a quick reminder of the command surface.
Troubleshooting
- Start with
x-cli auth status to confirm stored credentials are present.
- Use
--verbose to inspect request URLs, HTTP codes, and raw response details.
- If pagination stalls or you need the next page later, reuse the emitted cursor exactly.
- If commands fail after a long idle period, re-run
x-cli auth login.
- If several commands return
404 or start failing at once, inspect internal/api/endpoints.go and refresh the query IDs from X's current web bundle.
For auth, rate-limit, and endpoint-drift notes, read references/auth-and-debugging.md.
Source: freecodexyz/x-cli — distributed by TomeVault.
1---2name: x-cli3description: Use this skill when the task is to authenticate with X, fetch timelines, tweets, users, search results, followers, or following data through x-cli, or to troubleshoot x-cli auth, rate limits, and GraphQL query ID drift.4license: MIT5---67# X CLI89Use this skill to operate `x-cli` safely and consistently.1011## Use This Skill For1213- Logging into X through the browser-based auth flow14- Fetching home timelines, user timelines, tweets, user profiles, search results, followers, or following lists15- Using `--json` output for downstream parsing or automation16- Diagnosing auth failures, rate limits, pagination, or GraphQL query ID rotation17- Updating or validating the CLI's endpoint/query ID registry when X changes its internal API1819## Core Rules2021- Prefer `x-cli` over ad hoc `curl` requests to X when the CLI surface already covers the task.22- Prefer `--json` when another tool, agent, or script will consume the output.23- Treat `~/.x-cli/credentials.json` as managed state. Use `x-cli auth login`, `status`, and `logout` instead of editing it manually.24- Use `tweet get` with either a tweet ID or full X URL.25- Expect cursor-based pagination on list commands and preserve returned cursors when continuing a session.26- If multiple commands start returning `404` responses, suspect GraphQL query ID drift in `internal/api/endpoints.go`.2728## Quick Workflow29301. Verify the binary and auth state.312. Authenticate if needed.323. Run the smallest command that answers the task.334. Switch to `--json` for parsing or handoff.345. Follow pagination cursors or `--all` only when the user wants broader retrieval.356. Use `--verbose` when debugging HTTP failures or endpoint drift.3637## Prerequisites3839- `x-cli` available on `PATH`, or use the repo-local binary.40- Google Chrome installed for browser-based login.41- A valid X account session.4243For repo-local build and install commands, see [references/install-and-build.md](references/install-and-build.md).4445## Standard Command Path4647For a typical session:4849```bash50x-cli auth status51x-cli auth login52x-cli timeline home --count 2053x-cli tweet get https://x.com/jack/status/20 --json54x-cli user get @jack55x-cli search "golang" --type latest --json56```5758For follower graph inspection:5960```bash61x-cli followers @jack --count 5062x-cli following @jack --count 50 --json63```6465Load [references/command-map.md](references/command-map.md) when you need exact command shapes, pagination flags, or a quick reminder of the command surface.6667## Troubleshooting6869- Start with `x-cli auth status` to confirm stored credentials are present.70- Use `--verbose` to inspect request URLs, HTTP codes, and raw response details.71- If pagination stalls or you need the next page later, reuse the emitted cursor exactly.72- If commands fail after a long idle period, re-run `x-cli auth login`.73- If several commands return `404` or start failing at once, inspect `internal/api/endpoints.go` and refresh the query IDs from X's current web bundle.7475For auth, rate-limit, and endpoint-drift notes, read [references/auth-and-debugging.md](references/auth-and-debugging.md).7677---78> Source: [freecodexyz/x-cli](https://github.com/freecodexyz/x-cli) — distributed by [TomeVault](https://tomevault.io).79<!-- tomevault:4.0:skill_md:2026-06-21 -->