Cocurdex

CLI

cocurdex CLI 参考——打开桌面应用,管理笔记、Issue、演示文稿、会话、团队、脚本编排、设备、provider 与 skills。

cocurdex CLI 是应用私有产品数据和 daemon 操作受支持的命令行边界。外部工具和 Agent 应该使用 CLI,而不是读取私有数据库文件。

大多数数据和会话命令需要桌面 daemon(通常在打开桌面应用时启动)。

安装

当 CLI 随桌面应用打包时,从 设置 → 常规 → Shell 命令 安装启动器,让 cocurdex 出现在 PATH 上。

cocurdex --version
cocurdex --help

在 monorepo 开发中,使用 workspace 里的 CLI 包(apps/cli)。

找到桌面二进制

打开流程需要 Cocurdex / Electron 二进制。解析顺序包括:

  1. COCURDEX_ELECTRON 环境变量
  2. 正运行在 Electron / 打包应用内
  3. monorepo 下开发用的 node_modules/electron
  4. 常见 macOS 安装路径(/Applications/Cocurdex.app/...)

解析失败时,先打开一次桌面应用并安装 CLI 启动器,或设置 COCURDEX_ELECTRON。

平台说明:

  • Linux AppImage——启动器运行一份稳定的 CLI 副本,AppImage 挂载点消失后依然可用。
  • Windows——启动器是用户 PATH 上的一个 shim;卸载 Cocurdex 时会一并移除 shim 及其 PATH 条目。

全局 flags

Flag含义
--help / help打印用法
--version / -v / -V / version打印 CLI 版本
--json支持处输出机器可读结果

打开桌面应用

VS Code 风格的文件夹打开:

cocurdex                 # 打开应用
cocurdex .               # 把当前目录作为工作区打开
cocurdex open            # 打开应用
cocurdex open /path/to/project

笔记

cocurdex note list [--json]
cocurdex note show <id> [--json]
cocurdex note create --title <title> [--body <markdown>] [--parent <id>] [--workspace <id>] [--folder] [--json]
cocurdex note update <id> [--title <title>] [--body <markdown>] [--json]
cocurdex note move <id> --parent <note-id> | --root [--json]
cocurdex note delete <id> [--json]
cocurdex note backlinks <id> [--json]
cocurdex note tags [note-id] [--json]
Flag含义
--title创建时必填
--bodyMarkdown 正文(- 从 stdin 读取)。--body-file <path> 从文件读取
--root在 move 时把笔记提升到侧栏根级
--folder创建文件夹节点而非笔记
--parent父级笔记/文件夹 id
--workspace可选的工作区关联

更新在底层使用乐观并发(revision)——始终优先用 CLI/桌面端,而非编辑 SQLite。

Issue

默认视图 id 是 project,除非传入 --view。

cocurdex issue list [--status <column>] [--label <name>] [--parent <id>] [--open] [--view <id>] [--json]
cocurdex issue show <id> [--detail] [--view <id>] [--json]
cocurdex issue create --title <title> [--status <column>] [--priority <id>] [--body <text>] [--workspace <id>] [--parent <id>] [--labels <ids>] [--view <id>] [--json]
cocurdex issue update <id> [--title <title>] [--body <text>] [--status <column>] [--priority <id>] [--workspace <id>|none] [--parent <id>|none] [--labels <ids>] [--view <id>] [--json]
cocurdex issue move <id> <column> [--view <id>] [--json]
cocurdex issue comment <id> --body <markdown> [--json]
cocurdex issue relate <id> blocks|related|duplicate <id> [--json]
cocurdex issue unrelate <id> blocks|related|duplicate <id> [--json]
cocurdex issue labels [--json]
cocurdex issue label create --name <name> [--color <color>] [--json]
cocurdex issue label delete <id|name> [--json]
cocurdex issue delete <id> [--view <id>] [--json]
cocurdex issue views [--json]

默认状态列:backlog、doing、review、done。 默认优先级列:urgent、high、medium、low、none。

示例:

cocurdex issue create --title "Fix download page" --status backlog --priority high
cocurdex issue move <id> doing
cocurdex issue list --status doing

演示文稿

演示文稿是应用私有记录:用 Markdown 写入,得到 16:9 的幻灯片,并检查溢出、空白页和未知槽位。版式、主题、放映和 /cocurdex-deck skill 见演示文稿。

cocurdex deck list [--json]
cocurdex deck show <id> [--json]
cocurdex deck create [--title <title>] [--markdown-file <path|-> | --content-file <path|->] [--workspace <id>] [--json]
cocurdex deck update <id> [--title <title>] [--markdown-file <path|-> | --content-file <path|->] [--expected-revision <n>] [--json]
cocurdex deck edit <id> --ops-file <path|-> [--expected-revision <n>] [--json]
cocurdex deck image <id> --slide <slideId> --file <path.png|path.jpg> [--alt <text>] [--replace <elementId>] [--expected-revision <n>] [--json]
cocurdex deck check <id> [--json]
cocurdex deck export <id> --output <path.pptx|path.pdf> [--format pptx|pdf] [--json]
cocurdex deck import <file.pptx> [--title <title>] [--workspace <id>] [--json]
cocurdex deck read <file.pptx> [--json]
cocurdex deck delete <id> [--json]
Flag含义
--markdown-file / --content-fileMarkdown 源,或结构化的演示文稿 JSON。- 从 stdin 读取。二者互斥,也都可以省略。都不传时,创建得到没有幻灯片的演示文稿,更新则保留现有幻灯片
--ops-file编辑 ops 的 JSON 数组,或 { "ops": [ ... ] }。按顺序应用;有一步失败则不会保存
--expected-revision来自 deck show 的修订号。过期的写入会失败并提示 Deck was modified
--output / --format导出路径。格式为 pptx 或 pdf,也可由输出文件的扩展名决定
--workspace创建或导入时可选的工作区 id
--slide / --file / --alt / --replace添加 PNG 或 JPEG(最大 20 MB),或换掉一张并保留其框

deck list 打印 id、标题、幻灯片数量、修订号和更新时间。deck show 带上检查问题。deck read 把 PowerPoint 文件打成 Markdown,不会新建演示文稿。deck import 新建演示文稿,原文件保持不动。单独一行 --- 用来分页;以 Notes: 或 备注: 开头的段落开始演讲者备注。

搜索

cocurdex search <query> [--kind note|issue] [--workspace <id>] [--json]

Skills

产品 skills 以 cocurdex-* 命名空间隔离。安装是手动的(非自动)。

cocurdex skills list [--json]
cocurdex skills status --scope project|global [--root <path>] [--json]
cocurdex skills install --scope project|global [--root <path>] [--json]
cocurdex skills remove --scope project|global [--root <path>] [--json]

--root 在 project 范围下默认为当前工作目录。cocurdex skill 也可作为别名。见 Skills。

Daemon 与工作区

cocurdex daemon status
cocurdex workspace list

设备与本地网页

打印本地网页客户端 URL(桌面应用必须在运行):

cocurdex web [--json]

把另一台设备配对到主机 daemon。完整模型见设备与本地网页。

cocurdex host status [--json]
cocurdex host remote enable [--port <port>] | disable [--json]
cocurdex host pair --label <name> [--scopes read,interact,approvals] [--ttl <minutes>] [--json]
cocurdex host pairings [--json]
cocurdex host pairing cancel <pairing-id>
cocurdex host devices [--json]
cocurdex host revoke <device-id>
cocurdex host audit [--limit <n>] [--json]

--scopes 是逗号分隔的 read、interact、execute、files.read、files.write、git.destructive、approvals、credentials。默认配对权限是 read,interact,approvals。

工作树

托管的 git 工作树为会话提供工作区仓库的隔离检出。

cocurdex worktree list [--json]
cocurdex worktree settings [--root <path>] [--fetch|--no-fetch] [--json]
cocurdex worktree create --workspace <id|path> --branch <name> [--start-point <rev>] [--json]
cocurdex worktree remove --workspace <id|path> --path <worktree-path> [--json]

不带 flags 的 worktree settings 打印当前设置;传 --root 和/或 --fetch/--no-fetch 则更新。--root 设置 Cocurdex 创建托管工作树的目录(置空则恢复默认位置);--fetch 控制创建工作树之前是否先 fetch 仓库。

会话

cocurdex session list
cocurdex session create --workspace <id|path> --agent <agent> --provider <provider> --model <model>
cocurdex session tui [session-id]
cocurdex session tui --workspace <id|path> --agent <agent> --provider <provider> --model <model>
cocurdex session send <session-id> <prompt>
cocurdex session tree <session-id> [--depth <n>] [--json]
cocurdex session fork <session-id> [--through <message-id>] [--title <title>] [--json]
cocurdex session switch-agent <session-id> <agent> [--json]
cocurdex session handoffs <session-id> [--json]
cocurdex session peers <session-id>
cocurdex session send-peer <from-session-id> <to-session-id> <message>
cocurdex session peer-inbound <session-id> deliver|refuse
cocurdex session stop <session-id>
Flag必填场景含义
--workspacecreate / tui 创建工作区 id 或文件系统路径
--agentcreate / tui 创建Agent id:claude-agent、codex、opencode、pi,或已安装的 ACP Registry Agent,如 acp:cursor、acp:devin、acp:grok-build
--providercreate / tui 创建provider list 中的 provider 配置 id
--modelcreate / tui 创建provider models 中的模型 id

不带 flags 的 session tui 附着到最近的非归档会话。它不支持 --json。

session tree 打印执行树。fork 从当前会话开一个新会话(--through 截到该消息)。switch-agent 在空闲会话上更换运行时。handoffs 列出分叉或切换 Agent 后的上下文交接。见分叉与切换 Agent。

peers 列出某会话可以发消息的会话;send-peer 把消息作为新一轮投递(或排在当前一轮之后);peer-inbound refuse 让会话拒收其他会话的消息。见会话间消息。

Agent id 与权限见 Agent。

团队

一个主会话及其队友。完整模型见 Agent 团队。

cocurdex team get --lead <session-id> [--json]
cocurdex team create --lead <session-id> --template <template-id>
cocurdex team spawn --lead <session-id> --name <name> [--title <title>] --prompt <prompt> [--role <role-id>] [--agent <agent>] [--worktree]
cocurdex team stop --team <team-id>
cocurdex team stop-member --team <team-id> --session <session-id>
cocurdex team roles [--json]
cocurdex team templates [--json]
cocurdex team spawn-template --lead <session-id> --template <template-id> [--prompt <prompt>]
Flag含义
--lead拥有该团队的主会话
--name队友名称,小写 slug
--title应用中显示的标题;不填则显示名称
--role队友使用的已保存 Agent 角色
--agent不使用角色时的 Agent id,默认与主会话相同
--worktree让队友运行在独立的托管 git 工作树中

脚本编排

经批准后分发给子 Agent 的 JavaScript 扇出。完整模型见脚本编排。

cocurdex script-run list [--session <requester-session-id>] [--workspace <workspace-id>] [--json]
cocurdex script-run get --run <run-id> [--json]
cocurdex script-run create --session <requester-session-id> --name <name> --file <script.js>
cocurdex script-run start --run <run-id> [--max-agents <n>]
cocurdex script-run cancel --run <run-id>

create 创建一个归属于发起会话的 draft 运行;start 批准并以给定的 Agent 上限(正整数)运行。结果会送回发起会话。

Provider

Provider 配置为内置 Pi Agent 和共享模型目录提供数据。见 Provider 与设置。

cocurdex provider list [--json]
cocurdex provider templates [--json]
cocurdex provider add <id> [--template <template-id>] [--name <name>] [--base-url <url>]
cocurdex provider update <id> [--name <name>] [--base-url <url>] [--enable|--disable]
cocurdex provider remove <id>
cocurdex provider status <id> [--json]
cocurdex provider login <id> [--method oauth|api_key] [--no-tui]
cocurdex provider logout <id>
cocurdex provider key set <id>        # 从 stdin(或隐藏输入提示)读取密钥
cocurdex provider key clear <id>
cocurdex provider models <id> [--refresh] [--json]
cocurdex provider model add <id> <model-id> --api <api> [--name <name>]
cocurdex provider model remove <id> <model-id>
cocurdex provider default [--agent <agent>] [--provider <id> --model <model-id>] [--json]
cocurdex provider import <file|->     # pi models.json 格式
cocurdex provider export [--output <file>]
命令说明
add需要 --base-url,或 provider templates 中的某个 --template
login默认 --method oauth;stdin 和 stdout 都是终端时使用终端 UI,--no-tui 则用纯文本
models --refresh从 provider 拉取最新目录,而不是读取已保存的列表
model add --api取值为 openai-completions、openai-responses、openai-codex-responses、anthropic-messages、google-generative-ai、mistral-conversations 之一
default不带参数时列出每个 Agent 的默认 provider 与模型;带 --agent --provider --model 时设置默认值

Agent 角色

保存好的 Agent 预设(Agent + provider/模型 + 权限 + 推理轴、头像、描述),可用于会话、队友或脚本编排的子 Agent。在桌面 UI 中管理;从 CLI 列出:

cocurdex role list [--json]

CLI 不是什么

  • 第二份事实源——本地数据库仍由桌面 daemon 掌管
  • 多面板桌面工作台的完整替代品
  • 云端团队管理工具(那会是独立的 console + API)
  • 打开 cocurdex.sqlite 或私有 schema 路径的许可证

安全

不要把脚本指向 cocurdex.sqlite 或私有 schema 路径。它们是实现细节,预发布期间可能在没有兼容性承诺的情况下变化。优先使用 --json 输出和 CLI 返回的稳定 id。

相关

本页目录