A Clawdbot skill for posting to X (Twitter) using the official API.
The excellent bird CLI is great for reading Twitter — timeline, mentions, search, etc. But posting through bird gets blocked by Twitter's bot detection:
❌ Failed to post tweet: Authorization: This request looks like it might be automated.
To protect our users from spam and other malicious activity, we can't complete this action right now.
Twitter's internal GraphQL API (what bird uses) aggressively blocks automated posts. The only reliable way to post is through the official X API with OAuth 1.0a.
The X API isn't free:
- Free tier: 1,500 posts/month, but requires credits (pay-as-you-go)
- Basic tier: $100/month for higher limits
- You need to create a Developer account and app at developer.x.com
Copy the skill to your Clawdbot skills directory:
cp -r x-api ~/.clawdbot/skills/
cd ~/.clawdbot/skills/x-api/scripts
npm install- Go to https://developer.x.com/en/portal/dashboard
- Create a Project and App
- Set App permissions to Read and Write
- Generate keys from "Keys and tokens" tab
Option A: Environment variables
export X_API_KEY="your-api-key"
export X_API_SECRET="your-api-secret"
export X_ACCESS_TOKEN="your-access-token"
export X_ACCESS_SECRET="your-access-token-secret"Option B: Config file at ~/.clawdbot/secrets/x-api.json
{
"consumerKey": "your-api-key",
"consumerSecret": "your-api-secret",
"accessToken": "your-access-token",
"accessTokenSecret": "your-access-token-secret"
}node ~/.clawdbot/skills/x-api/scripts/x-post.mjs "Your tweet text here"Multi-line tweets work too:
node ~/.clawdbot/skills/x-api/scripts/x-post.mjs "Line one
Line two
Line three"| Task | Tool |
|---|---|
| Reading (timeline, mentions, search) | bird CLI — free, cookie-based |
| Posting | This skill — official API, paid |
MIT
Built by Lobster General Intelligence 🦞