Post to X (Twitter) using the official API with OAuth 1.0a. Use when you need to tweet, post updates, or publish content. Bypasses rate limits and bot detection that affect cookie-based approaches like bird CLI.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install x-api或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install x-api⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/x-api/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: x-api description: Post to X (Twitter) using the official API with OAuth 1.0a. Use when you need to tweet, post updates, or publish content. Bypasses rate limits and bot detection that affect cookie-based approaches like bird CLI. ---
Post to X using the official API (OAuth 1.0a).
bird tweet gets blocked by bot detection)For reading (timeline, search, mentions), use bird CLI instead — it's free and works well for reads.
- API Key (Consumer Key) - API Key Secret (Consumer Secret) - Access Token - Access Token Secret
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"
}
npm install -g twitter-api-v2
x-post "Your tweet text here"
Or with full path:
node /path/to/skills/x-api/scripts/x-post.mjs "Your tweet text here"
Supports multi-line tweets:
x-post "Line one
Line two
Line three"
Returns the tweet URL on success.
For reading, searching, and monitoring — use the bird CLI:
bird home # Timeline
bird mentions # Mentions
bird search "query" # Search
bird user-tweets @handle # User's posts
bird read <tweet-url> # Single tweet
402 Credits Depleted: Add credits in X Developer Portal → Dashboard
401 Unauthorized: Regenerate Access Token (ensure Read+Write permissions are set first)
No credentials found: Set env vars or create config file (see Setup above)
安装 X Api 后,可以对 AI 说这些话来触发它
Help me get started with X Api
Explains what X Api does, walks through the setup, and runs a quick demo based on your current project
Use X Api to post to X (Twitter) using the official API with OAuth 1
Invokes X Api with the right parameters and returns the result directly in the conversation
What can I do with X Api in my marketing & growth workflow?
Lists the top use cases for X Api, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/x-api/ 目录(个人级,所有项目可用),或 .claude/skills/x-api/(项目级)。重启 AI 客户端后,用 /x-api 主动调用,或让 AI 根据上下文自动发现并使用。
X Api 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
X Api 可免费安装使用。请查阅仓库了解许可证信息。
Post to X (Twitter) using the official API with OAuth 1.0a. Use when you need to tweet, post updates, or publish content. Bypasses rate limits and bot detection that affect cookie-based approaches like bird CLI.
X Api 属于「Marketing & Growth」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my marketing & growth tasks using X Api
Identifies repetitive steps in your workflow and sets up X Api to handle them automatically