xp

xp

A personal CLI for everyday tweeting — post, thread, reply, and manage your tweets from the terminal.

terminal
$ xp "Hello, world!"
tweet_id: 1893684025138438386
url: https://x.com/i/status/1893684025138438386

Features

Simple

Just xp "text". No API paths, no JSON payloads.

🔗

Threads

xp thread "1" "2" "3" — auto reply chain.

💬

Read & Reply

xp get, xp me, xp mentions, xp reply for full workflow.

{}

JSON output

--json flag on any command. Pipe to jq.

💾

Local cache

Fetched tweets are cached locally. Browse offline with xp cache list — saves paid API calls. Use --cache-dir to store in a custom location for Git versioning.

🤖

Agent-friendly

Machine-readable output, non-interactive flags, exit codes.

📦

Zero deps

Single binary. OAuth 1.0a via WebCrypto. xp upgrade to update.

📷

Images

--image photo.jpg — attach up to 4 images (JPG/PNG/GIF/WebP).

Install

brew install tawachan/tap/xp

macOS and Linux. Update with brew upgrade xp.

Setup

$ xp auth login
# 1. Enter your API Key & Secret from the Developer Portal
# 2. Authorize in browser
# 3. Enter the PIN
# Done!

Before running auth login:

In your app's Settings on the Developer Portal, click Set up under "User authentication settings" and enable OAuth 1.0a with Read and Write permissions. Set Callback URI to https://example.com (placeholder).

Get your API keys from the X Developer Portal. Pay-Per-Use pricing recommended.

Usage

xp "Hello from xp!"

Post a tweet. Or use xp tweet "text".

xp thread "First" "Second" "Third"

Post a thread. Each tweet auto-replies to the previous one.

xp reply 1234567890 "Nice!"

Reply to a specific tweet.

xp "Hello" --image photo.jpg

Attach up to 4 images (JPG/PNG/GIF/WebP, 5MB each). Works with tweet, reply, thread.

xp get 1234567890

Fetch a tweet by ID. Cached locally to avoid repeat API calls.

xp me --json | jq '.[0].text'

List your recent tweets. Use --limit N to control count, --before / --after to paginate.

xp mentions --json | jq '.[0].author_username'

List your mentions. All read commands include author_username. Same flags as me.

xp cache list --year 2026 --limit 10

Browse cached tweets offline. Filter with --year, --month, --limit. Also: xp cache show <id> / xp cache clear.

xp delete 1234567890

Delete a tweet by ID.

xp upgrade

Download and install the latest release from GitHub.

xp config show

Show current config (masked). Use xp config set --cache-dir=PATH to customize cache location, xp config unset --cache-dir to reset.

xp "Hello" --json

Add --json to any command for structured JSON output.