跳到正文
← 返回首页

c456-cli 使用说明

通过 HTTP API v1 读写收录、打法、讲解等;适合本地与 AI Agent 集成。

安装

npm install -g c456-cli
# 或
bun add -g c456-cli

安装后的命令名为 c456。也可用 npx c456-cli / bunx c456-cli 单次执行。

配置

API Key

在 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)
intakeAI 录入入口 intake new 与通用 list/show/update/delete

全局选项:-B / --base-url 对应环境变量 C456_URL不设全局 -k 作为 API Key(与子命令里 -k = kind 冲突)。完整示例见开源仓库 c456-cli 的 README。

与 API 的对应

  • signal / tool / channel 的 new → POST /api/v1/intakes(body 含 kind)
  • show / update / delete / list → GET|PATCH|DELETE /api/v1/intakes/:idGET /api/v1/intakes
  • signal refinePOST /api/v1/intakes/:id/refinements
  • fetch profilePOST /api/v1/fetches
  • search …GET /api/v1/search/intakes/search/playbooks
  • playbook */api/v1/playbooks
  • walkthrough */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

第一次同步

  1. 安装 CLI 并执行 c456 config set-key …
  2. 自托管时设置 c456 config set-url …
  3. c456 config show 确认
  4. 任选: c456 signal new -t "标题" -b "正文"c456 tool new -u "https://…" --auto-resolve-urlc456 intake new -t "…" -b "…"

← 返回帮助首页