c456-cli 使用说明
通过 HTTP API v1 读写收录、打法、讲解等;适合本地与 AI Agent 集成。
通过 HTTP API v1 读写收录、打法、讲解等;适合本地与 AI Agent 集成。
npm install -g c456-cli
# 或
bun add -g c456-cli
安装后的命令名为 c456。也可用 npx c456-cli / bunx c456-cli 单次执行。
在 Web 端 API 访问令牌 创建密钥(仅创建时可见全文)。
c456 config set-key <your-token>
# 或环境变量(适合 CI)
export C456_API_KEY=<your-token>
c456 config set-url https://your-c456.example.com
# 或
export C456_URL=https://your-c456.example.com
# 单次命令覆盖(推荐多环境)
c456 -B https://your-c456.example.com intake list
配置文件遵循 XDG,默认 ~/.config/c456/config.json;可通过 XDG_CONFIG_HOME 调整。不要将含密钥的文件提交到仓库。
c456 config show
| 命令 | 用途 |
|---|---|
| config | 读写 baseUrl / API Key |
| signal | 信号类收录 CRUD、列表、漏斗 refine 等 |
| tool | 工具类收录(常配合 URL 与 auto-resolve) |
| channel | 渠道类收录 |
| fetch | 按 URL + profile 抓取资料段(不落库) |
| search | 搜索收录 / 打法 |
| playbook | 打法 CRUD 与列表 |
| walkthrough | 讲解 CRUD(可上传 .cast) |
| intake | AI 录入入口 intake new 与通用 list/show/update/delete |
全局选项:-B / --base-url 对应环境变量 C456_URL。不设全局 -k 作为 API Key(与子命令里 -k = kind 冲突)。完整示例见开源仓库 c456-cli 的 README。
signal / tool / channel 的 new → POST /api/v1/intakes(body 含 kind)GET|PATCH|DELETE /api/v1/intakes/:id、GET /api/v1/intakessignal refine → POST /api/v1/intakes/:id/refinementsfetch profile → POST /api/v1/fetchessearch … → GET /api/v1/search/intakes 或 /search/playbooksplaybook * → /api/v1/playbookswalkthrough * → /api/v1/walkthroughs(创建/更新可为 multipart)intake new(AI)→ POST /api/v1/intakes/ai,状态查询 → GET /api/v1/intakes/ai/status/:job_token详情见 API v1 参考 与仓库内 docs/20-engineering/specs/api-v1.md。
c456 config set-key …c456 config set-url …c456 config show 确认c456 signal new -t "标题" -b "正文" 或 c456 tool new -u "https://…" --auto-resolve-url 或 c456 intake new -t "…" -b "…"