X/Twitter — xpost CLI
All X/Twitter interactions go through the bundled xpost script.
Setup
- Install the script:
cp "/Users/bergel/Claude code/skills/x-posting/scripts/xpost" ~/bin/xpost
chmod +x ~/bin/xpost
# Add to PATH (add to your .zshrc for persistence)
export PATH="$HOME/bin:$PATH"
- Store your X API keys at
~/.config/x-api/keys.env:
X_API_KEY=...
X_API_SECRET=...
X_ACCESS_TOKEN=...
X_ACCESS_TOKEN_SECRET=...
X_USER_ID=...
Get these from https://developer.x.com/en/portal/dashboard (Basic tier: $200/mo).
- No external dependencies. The script is pure Python 3 (uses only stdlib). No
pip install, nonpm install.
Commands
# Post a tweet
xpost post "Your tweet text here"
# Reply to a tweet
xpost reply <tweet_id> "Your reply text"
# Quote tweet
xpost quote <tweet_id> "Your quote text"
# Get mentions
xpost mentions [--count 20]
# Search recent tweets
xpost search "query string" [--count 10]
# Like a tweet
xpost like <tweet_id>
# Retweet
xpost retweet <tweet_id>
# Delete a tweet
xpost delete <tweet_id>
# Get a single tweet
xpost get <tweet_id>
# Home timeline
xpost home [--count 20]
# User timeline
xpost timeline <username> [--count 10]
Output
All commands output JSON by default. Use --pretty for formatted output or --text for plain text summary.
Rate Limits (Basic Tier)
- POST tweets: 100/15min, 10,000/24hrs
- GET mentions: 300/15min
- GET timeline: 900/15min
- Search recent: 300/15min
- Likes: 50/15min, 1,000/24hrs
Scheduling Tweets via Claude Code
Use the /schedule skill to schedule tweets at a specific time:
/schedule "Post this tweet via xpost: 'Your tweet text here'" at 2026-03-09T14:00:00
Or ask Claude Code to set up a recurring schedule:
"Schedule a daily tweet at 9am using xpost"
Tips
- The script handles OAuth 1.0a HMAC-SHA1 signing automatically
- No browser automation needed — everything is API-based
- For engagement: reply to mentions promptly, quote-tweet interesting content with your take