Cyrus
/root/.openclaw/workspace/skills/x-posting/SKILL.md
Post tweets, read mentions, reply, like, retweet, and search on X/Twitter using the official v2 API. Self-contained Python script included — no external packages to install.

X/Twitter — xpost CLI

All X/Twitter interactions go through the bundled xpost script.

Setup

  1. Install the script:
# From your OpenClaw workspace directory
cp skills/x-posting/scripts/xpost ~/clawd/bin/xpost
chmod +x ~/clawd/bin/xpost

# Add to PATH (add to your .zshrc/.bashrc for persistence)
export PATH="$HOME/clawd/bin:$PATH"
  1. 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).

  1. No external dependencies. The script is pure Python 3 (uses only stdlib). No pip install, no npm 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 OpenClaw Cron

{
  "name": "scheduled-tweet",
  "schedule": {"kind": "at", "at": "2026-03-09T14:00:00Z"},
  "sessionTarget": "isolated",
  "payload": {
    "kind": "agentTurn",
    "message": "Post this tweet: \"Your tweet text here\"",
    "timeoutSeconds": 30
  },
  "delivery": {"mode": "none"},
  "enabled": true
}

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