X / Twitter 读取与发布
Primary contract
- Credentials live in a user-local file, not in the repo:
- default path:
~/.nextclaw/secrets/x-bird.json
- default path:
- CLI 操作统一通过
scripts/x-bird.mjs;真实浏览器操作走当前可用的 Computer Use 工具,不受 CLI 路径限制。 - The script passes
--auth-tokenand--ct0explicitly tobird - 不依赖 bird 自动读取凭据环境变量;由 wrapper 显式传入。版本从实际解析到的
@steipete/bird/package.json核对,不把历史版本当成本机现状。
操作路由
读取与搜索使用下方命令。发布、浏览器操作或 CLI 故障时,读取发布路径与故障处理。已有发布授权不重复询问。
Setup
Store credentials once:
node .agents/skills/x-twitter-bird/scripts/x-bird.mjs auth set --auth-token '<token>' --ct0 '<token>'
Check the current account:
node .agents/skills/x-twitter-bird/scripts/x-bird.mjs whoami --plain
Common commands
Read bookmarks:
node .agents/skills/x-twitter-bird/scripts/x-bird.mjs bookmarks -n 20 --json
Read likes:
node .agents/skills/x-twitter-bird/scripts/x-bird.mjs likes -n 20 --json
Search:
node .agents/skills/x-twitter-bird/scripts/x-bird.mjs search 'DeepSeek V4 reasoning_content' -n 10 --json
Read a tweet or thread:
node .agents/skills/x-twitter-bird/scripts/x-bird.mjs read <tweet-id-or-url> --json
node .agents/skills/x-twitter-bird/scripts/x-bird.mjs thread <tweet-id-or-url> --json
Post only after the user explicitly asks:
node .agents/skills/x-twitter-bird/scripts/x-bird.mjs tweet 'text here'
node .agents/skills/x-twitter-bird/scripts/x-bird.mjs reply <tweet-id-or-url> 'text here'
Rules
- Treat
auth_tokenandct0as full login credentials - Never write them into repo files, docs, tests, or iteration logs
- 发布授权按发布路径 reference 处理。已授权的稳定 minor 发布在发布核验及公共链接检查完成后直接执行,不重复确认。
- Stable minor release posts should include one public-safe, high-information image by default. Choose the best fit among a real product screenshot, a benchmark/release summary card, AI-generated campaign art, or an AI-assisted composition containing an unaltered real screenshot. Never present generated UI as a real product screenshot or change verified release facts. Patch releases do not post unless the user explicitly overrides this rule.
- When
HTTP_PROXY/HTTPS_PROXYis required, invoke this wrapper with a Node version that supports environment proxies (for exampleNODE_USE_ENV_PROXY=1 <node-24+> scripts/x-bird.mjs ...). The wrapper launchesbirdwith the same Node executable so the proxy setting reaches X requests. - The wrapper refreshes current GraphQL query IDs before every
tweetorreply. 报错后区分 query ID、网络、频率限制和 226,不把所有错误归为账号封控;后续操作遵守 reference 的查重与停止条件。 - A successful write response is not completion by itself. 通过浏览器详情或 wrapper 回读已知 ID,核对作者、完整正文及素材后才报告成功并记录 URL。缺少 ID、回读失败或内容不符不能盲目重发。多个平台分别报告状态,一个成功不代表整批完成;新发不隐含授权删除旧帖。
- Prefer
--jsonfor read/search workflows so downstream analysis stays structured - If the user asks for only reading, do not post, like, follow, or unbookmark anything