CLI
@anakonn/ankk 是使用 ANKK Public API 的 Bun CLI 工具。
- Bun 1.3 或更高版本
- 針對您的品牌設定的公開 API 金鑰
無需安裝即可執行:
bunx @anakonn/ankk --json health全域安裝:
bun install -g @anakonn/ankkankk --json health初始設定
섹션 제목: “初始設定”全域配置:
ankk config setup --scope global專案本地配置:
ankk config setup --scope project配置解析優先順序:
- CLI 選項,例如
--api-key和--config ANKK_API_KEY環境變數- 專案層級的
.ankk/config.json - 全域的
~/.ankk/config.json
若未配置,預設為 https://api.ankk.app。ankk config show 會顯示目前的設定,而不會洩露完整的 API 金鑰。
可用命令
섹션 제목: “可用命令”| 命令 | 用途 |
|---|---|
health | 檢查 API 健康狀態 |
upgrade | 升級全域安裝 |
openapi | 檢視或取得 OpenAPI 結構定義 |
brand | 管理與 API 金鑰相關聯的品牌詳情 |
connections | 檢查 SNS 連線 |
contents | 列出、查詢、發佈和取消排程內容 |
comments | 取得、發佈、重新整理和管理留言 |
reply-jobs | 建立並監控回覆作業 |
analytics | 取得分析資料與指標摘要 |
webhooks | 管理 Webhook 訂閱 |
config | 管理 CLI 配置 |
若要檢視任何命令可用的選項,請執行 ankk <command> --help。
發佈內容
섹션 제목: “發佈內容”payload.json:
{ "connection_id": "<connection_id>", "idempotency_key": "cli-publish-001", "text": "Published via CLI."}ankk contents publish --file payload.jsonankk contents publish --file payload.json --scheduled-for 2026-08-10T09:00:00Z在腳本和 AI 用戶端中使用 --json:
ankk --json connections listankk --json contents get <content_id>