Skip to content

v0.1.0

Latest

Choose a tag to compare

@github-actions github-actions released this 13 Jun 15:54
v0.1.0
52c4ab3

x is a fast, friendly command line for X (Twitter): one pure-Go binary that reads tweets, profiles, timelines, threads, and search over X's free public surfaces and crawls accounts into a local SQLite store. It is strictly read-only — it never posts, likes, follows, or changes your account. No paid API, no developer key, nothing to sign up for.

Documentation: https://x-cli.tamnd.com (mirror: https://tamnd.github.io/x-cli)

x tweet 20                         # a single tweet
x user nasa                        # a profile
x timeline nasa --guest -n 20      # a user's recent tweets
x search "from:nasa filter:media" --guest -o jsonl

Three free tiers, auto-selected

x speaks only X's own free, public surfaces — the same ones a logged-out browser uses — and picks the cheapest tier that can answer each call:

  • Tier 0 — syndication. No auth at all. Single tweets, profiles, and the recent timeline window.
  • Tier 1 — guest GraphQL. Opt in with --guest. Mints and caches a guest token the way the web client does, then pages deeper into timelines and resolves more.
  • Tier 2 — session GraphQL. Your own browser cookies, imported once with x auth import. Unlocks the logged-in reads: search, followers and following, your home timeline, and bookmarks. Used only to read.

To look like the web client, x sends an x-client-transaction-id header and a browser-faithful identity on each GraphQL request.

What you get

  • Read. tweet, user, timeline, replies, media, thread, poll, quotes, and mentions — most work with no auth.
  • Search and discover. search (with --product Top/Latest/Photos), counts, followers, following, likers, retweeters, likes, and list.
  • Your session. home and bookmarks read your own views, and an imported session deepens search and the follower graph.
  • Shape the output. -o table|json|jsonl|csv|tsv|url|raw, --fields to project columns, and --template for a Go text/template per row. IDs are always strings, so a snowflake never loses precision in jq or a spreadsheet.
  • Local store. --db on any read tees entities into SQLite, so a read doubles as a crawl. x crawl walks accounts breadth-first, and x db queries what you have collected.

Install

go install github.com/tamnd/x-cli/cmd/x@latest

Or grab a prebuilt binary below — archives for Linux, macOS, Windows, and FreeBSD on amd64/arm64/arm/386, plus deb, rpm, and apk packages. The binary is pure Go (CGO_ENABLED=0) with no runtime dependencies.

Container image:

docker run --rm ghcr.io/tamnd/x:0.1.0 user nasa

Verify the download

Each release ships checksums.txt and a keyless cosign signature over it, plus a CycloneDX SBOM per archive.

cosign verify-blob \
  --certificate checksums.txt.pem \
  --signature checksums.txt.sig \
  --certificate-identity-regexp 'https://github.com/tamnd/x-cli' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com \
  checksums.txt
sha256sum -c checksums.txt --ignore-missing

Exit codes

x returns a specific code per outcome — 0 ok, 1 generic, 2 usage, 3 no results, 4 needs-auth, 5 rate-limited, 6 not-found — so scripts can branch on them.

License

x is derived from nitter and is licensed under the GNU AGPL-3.0. The attribution NOTICE ships in every archive and package next to the LICENSE.