一键导入
threads-cli
Threads API CLI — publish posts, reply, publish thread chains. Supports Agent mode via --confirm --yes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Threads API CLI — publish posts, reply, publish thread chains. Supports Agent mode via --confirm --yes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | threads-cli |
| description | Threads API CLI — publish posts, reply, publish thread chains. Supports Agent mode via --confirm --yes. |
唯讀(批次 A 尚未實作,批次 B 補齊):
threads posts search <keyword> — 搜尋貼文threads posts list --recent N — 列自己最近貼文threads post insights <id> — 讀單篇數據threads post replies <id> — 列回覆threads account info — 帳號資訊threads account insights — 帳號數據寫入(批次 A 已實作):
threads post publish <text> — 發一則貼文threads reply <post_id> <text> — 回覆既有貼文threads post publish-chain <file> — 發串文(每行一則,空行濾除)系統:
threads --versionthreads --helpthreads <subcommand> --help寫入指令必須用 --confirm --yes 才會真的執行:
threads post publish "..." --confirm --yesthreads reply <id> "..." --confirm --yesthreads post publish-chain file.txt --confirm --yes規則:
--confirm:dry-run(只印會發什麼)--confirm 沒 --yes(非 TTY 環境):hard-error exit 2--yes 沒 --confirm:hard-error exit 2查詢指令支援 --json。批次 A 的 --json flag 已註冊但 inert(寫入指令無 JSON 輸出)。批次 B 實作唯讀指令時啟用。
每行一則貼文,空行會被濾除。目前不支援「多段落同一則」— 若需要,用 \n 轉義字元或等批次 B 評估進階輸入格式。
--limit 上限 25(專案設定於 threads_client.py:75;API 真正上限 50)--author flag 不提供(Threads API 忽略此參數)len() 計算,可能與 Threads 平台顯示略有差異(emoji ZWJ 等)docs/dev/api-exploration-results.md| Code | 情境 |
|---|---|
| 0 | 成功 / dry-run 完成 / 使用者取消 |
| 1 | API 失敗 / 網路錯誤 / Token 缺失 / 檔案讀取失敗 / ChainMidwayError |
| 2 | 使用者用法錯誤(--confirm --yes 組合錯誤、--on-failure=retry/rollback 未實作、unknown subcommand) |
寫入指令需要 Threads access token 包含 threads_content_publish 權限。若 token scope 不足會回 API 400 錯誤。Token 取得 / 續期:https://developers.facebook.com/tools/access-token-tool/
docs/superpowers/specs/2026-04-15-threads-cli-packaging-design.mddocs/dev/api-exploration-results.mddocs/dev/cli-anything-research.mdUse when the user wants to write a Threads post end-to-end starting from raw dump (no pre-existing angle) — dump-first workflow with 10 steps: dump → main thread → interview supplement → diagnosis → narrative draft → hooks → user calibration → finalize → anti-template → versions. Triggers: user says 「我有東西想寫但還沒想清楚」/「幫我從原始素材寫文」/「跑寫文工作流」/「我要寫 Threads 但沒 angle」, dumps raw material without a pre-locked angle. PREREQUISITE: none (Step 1 accepts raw dump). Do NOT use when user has a locked angle.md — use threads-write-post v2 (which starts from angle). Do NOT use for Stage 0 angle decisions if user is still unsure — use threads-angle-gate first.
Use when the user wants to write a Threads post end-to-end after the angle is locked — pick framework, plan thread skeleton, map algorithm mechanisms, design interaction, draft, review, publish. Triggers: user says 「幫我寫貼文」/「從 angle 寫到發文」/「跑 advisor pipeline」/「我有 angle.md 了下一步是」, asks to continue from an existing drafts/*.angle.md, or wants the full Stage 1→7 workflow. PREREQUISITE: angle.md must exist (run `threads-angle-gate` first if it doesn't). Do NOT use for Stage 0 angle decisions — that is `threads-angle-gate`'s job. Do NOT use for pure CLI ops (publish/list/insights) — that is `threads-cli`. Do NOT use for analytics-only queries — that is `threads-advisor analyze`.
Use when the user wants to decide the sharpness / angle of a Threads post BEFORE drafting, or when a draft reads like event recounting without a clear reason to share. Triggers: user says 「幫我想切入點」/「這篇要怎麼切」/「我想寫 X 但不知道怎麼下筆」, pastes raw material asking to turn it into a post, or shows a draft they themself say feels flat / 沒重點 / 沒銳利點. Do NOT use for revising drafts that already have a clear angle—use `threads-advisor review` instead. Do NOT use for pure info queries or historical insight analysis.
How to use the `threads` CLI and `threads-advisor` tools to operate the user's Threads account — publish posts, reply, list/search posts, fetch insights, delete posts, analyze performance, review drafts. Use this skill whenever the user asks to post on Threads, check their Threads analytics/insights, list or search their posts, reply to a post, delete a post, analyze which posts perform best, review a draft before posting, or any Threads account operation. Also use when the user mentions 'threads' CLI, 'advisor', Threads API operations, content strategy, or wants to interact with their Meta Threads account programmatically.