Fast, agent-friendly CLI for the X platform. JSON-first output, OAuth 2.0 PKCE auth, minimal dependencies.
- Post — create, reply, quote, thread, delete
- Read — get any post by ID with full metadata
- Timeline — home feed or any user's posts
- Search — recent posts with sort control
- Interact — like, repost, bookmark (OAuth 2.0 exclusive)
- Users — profile lookup, followers, following
- Mentions — posts mentioning the authenticated user
- Dual auth — OAuth 2.0 PKCE (recommended) with OAuth 1.0a fallback
- Auto token refresh — authenticate once, use indefinitely
- Agent-first — structured JSON on stdout, errors on stderr, meaningful exit codes
npm install -g xeetOr run directly without installing:
npx xeet --helpgit clone https://github.com/wangwalk/xeet.git
cd xeet
npm install
npm run build
npm link- Go to X Developer Portal
- Create or open your App
- In User authentication settings, enable OAuth 2.0
- Type: Native App (public client, no secret needed)
- Callback URL:
http://127.0.0.1:8477/callback - Copy your Client ID
xeet auth login --client-id <your-client-id>This opens a browser for authorization. After approving, tokens are saved to ~/.config/xeet/credentials.json.
xeet auth statusxeet post "Hello from xeet"
xeet user @XDevelopers
xeet bookmark <tweet-id>xeet auth login --client-id <id> [--client-secret <secret>] [--port 8477]Tokens auto-refresh via offline.access scope. Supports all endpoints including OAuth 2.0 exclusive features like Bookmarks.
xeet auth setupInteractive prompt for API Key, API Secret, Access Token, and Access Token Secret.
For CI/agent environments, set credentials via env vars:
# OAuth 2.0
export XEET_ACCESS_TOKEN=<token>
export XEET_REFRESH_TOKEN=<refresh-token> # optional
export XEET_CLIENT_ID=<client-id> # optional
# OAuth 1.0a (all four required)
export XEET_API_KEY=<key>
export XEET_API_SECRET=<secret>
export XEET_ACCESS_TOKEN=<token>
export XEET_ACCESS_TOKEN_SECRET=<token-secret>Detection priority: OAuth 1.0a (all four keys present) > OAuth 2.0 (access token only) > config file.
xeet auth statusShows auth type, credential source, user info, and for OAuth 2.0: token expiry and granted scopes.
xeet post "Hello world" # Create a post
xeet post "Check this out" --media a.jpg # Post with image
xeet reply <id> "Nice post!" # Reply to a post
xeet reply <id> "Look" --media b.png # Reply with image
xeet quote <id> "Check this out" # Quote a post
xeet quote <id> "Wow" --media c.gif # Quote with image
xeet thread "First" "Second" "Third" # Post a thread
xeet delete <id> # Delete a post
xeet read <id> # Get a post by ID--media supports jpg, png, gif, webp (max 5MB). Requires OAuth 2.0 with media.write scope.
xeet timeline # Home timeline
xeet timeline @username # User's posts
xeet timeline --limit 50 # Control result count
xeet timeline --since 2h # Filter by time (2h, 30m, 1d, ISO date)xeet search "query" # Search recent posts
xeet search "from:user" --limit 10 # With limit
xeet search "query" --sort relevancy # Sort by relevancy (default: recency)xeet like <id> # Like a post
xeet repost <id> # Repost (retweet)
xeet bookmark <id> # Bookmark (OAuth 2.0 only)xeet user @username # Get user profile
xeet followers @username --limit 50 # Get followers
xeet following @username --limit 50 # Get followingxeet mentions # Recent mentions
xeet mentions --limit 10 --since 1d # With filtersAll output is structured JSON on stdout. Errors go to stderr.
{
"ok": true,
"data": {
"id": "123456",
"text": "Hello world"
}
}{
"ok": false,
"error": {
"code": "AUTH_MISSING",
"message": "No credentials found."
}
}| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Auth error |
| 3 | Rate limited |
| 4 | Invalid arguments |
xeet --pretty user @XDevelopers # Human-friendly indented JSONxeet timeline @user --limit 10 | jq '.data.posts[].text'git clone https://github.com/wangwalk/xeet.git
cd xeet
npm install
npm run build # Build with tsup
npm run typecheck # Type check without emitting
npm run dev # Watch mode- TypeScript + tsup (ESM, Node 18+)
- Commander.js for CLI parsing
- @xdevplatform/xdk for X API client
- Minimal runtime dependencies (just the above two)
MIT