Discover MCPs & agents
Loading MCPs and agents…
Loading MCPs and agents…
Agent-first X/Twitter client in Go — JSON envelope per command, multi-account, cookie-safe anti-detection for autonomous agents
Fetched from the repository for this visit.
An agent-first X / Twitter client in Go.
One binary, one JSON envelope per command — so any agent runtime can drive X.
agentx is a from-scratch Go library + CLI built for autonomous agents. Every command prints a single predictable JSON object, supports multiple accounts, and keeps auth_token cookies alive by making traffic look like a real browser.
X flags/expires auth_token cookies aggressively when traffic doesn't look human. agentx signs every authenticated request with:
x-client-transaction-id — the exact algorithm x.com's web app runs (golden-tested),x-csrf-token, x-twitter-*, sec-fetch-*, stable User-Agent),AGENTX_UTLS=1).go build -o agentx ./cmd/agentx
# Register an account (cookies from a logged-in browser)
./agentx account add --name main --auth-token <auth_token> --ct0 <ct0>
# Read
./agentx feed -n 20
./agentx user jack
./agentx search --type Latest "golang" -n 20
./agentx analytics <tweet_id>
# Write
./agentx post "hello from agentx 👋"
./agentx reply <id> "nice!" --media pic.jpg
./agentx poll "Tabs or spaces?" --option Tabs --option Spaces
# Grok (AI)
./agentx grok "USD to IDR today?"
./agentx grok image "a majestic dragon" --out dragon.png
Every command prints one JSON envelope:
{ "ok": true, "schema_version": "1", "data": …, "pagination": {"nextCursor": "…"}, "rateLimit": {…} }
{ "ok": false, "schema_version": "1", "error": {"code": "…", "message": "…"} }
Check .ok, read .data, page with .pagination.nextCursor. Exit code is 0 on success, 1 on a handled error. Output is compact single-line JSON by default (token-efficient for agents) — add --pretty for human-readable output.
| Area | What you get |
|---|---|
| Read | feed (for-you / following), search, user / posts / tweet / thread / article, media tab, bookmarks (+ folders), likes, followers / following, lists + members, communities, mentions, notifications + unread, trends (+ locations), analytics (engagement rate), retweeters / likers |
| Write | post, reply, quote, polls (+ vote), like / retweet / bookmark, follow / mute / block, pin, media upload (+ alt text), auto-threads, scheduled tweets, drafts, profile / avatar / banner / settings, topics, list & community management |
| Grok | text answers with live web search, and image generation (download to file) |
| DM | classic DM send / list / media / download |
| Infra | multi-account, zero-auth FxTwitter fallback, uTLS + HTTP/2, rate-limit surfacing, query-id override for X rotations, watch streaming, media download |
See SKILL.md for the compact, token-efficient command reference and AGENTS.md for the full agent integration guide.
cmd/agentx CLI — one JSON envelope per command
pkg/agent High-level facade (account selection, client cache, fallbacks)
pkg/xclient Authenticated x.com GraphQL/REST client (+ transaction signing)
pkg/transaction x-client-transaction-id generator [golden-tested]
pkg/account Multi-account credential store (~/.agentx, 0600) [tested]
pkg/backends/fxtwitter Zero-auth single-tweet fallback
pkg/models Backend-agnostic Tweet / UserProfile / Page
pkg/xerrors Stable machine-readable error codes
import "github.com/dezxbt/agentx/pkg/agent"
ag := agent.New(store)
page, err := ag.Feed(ctx, "main", false, 20, "")
post (>280), edit, bookmark-folder writes.MIT — see LICENSE.
GitHub checked 39h ago - refresh overdue. Recently viewed repositories target hourly refresh.