Skip to content

DevCore CLI 概览 ​

使用 DevCore CLI 从终端脚本化操作 DevAgent、管理 worktree、控制 agent 终端、自动化内置浏览器,以及安装 agent skill。

DevCore CLI 是 devcore 命令行界面,可从任意 shell 脚本化操作正在运行的 DevAgent 编辑器。用它来创建和检查 worktree、驱动 agent 终端、打开文件和 diff、自动化内置浏览器、运行计划自动化任务、分享 HTML/Markdown artifact,以及从脚本或 AI agent 控制 DevAgent 原生工具。

它随桌面应用一起提供;在 设置 → 常规 → DevCore CLI 下进行注册。

agent 可以用以下命令安装配套的 DevCore CLI skill:

npx skills add https://github.com/Clouditera/devagent-skills --skill orca-cli
# 无头 / 没有 设置 UI 的情况下:
devcore skills install --skill orca-cli

有关每个可安装的 DevAgent skill(包括 devcore skills install / devcore skills update),参见 Skills registry & MCP。

安装与验证 ​

command -v devcore
devcore status --json

Worktree 命令 ​

devcore worktree ps --json
devcore worktree create --repo id:<repoId> --name my-task --issue 123 --json
devcore worktree current --json
devcore worktree set --worktree active --comment "reproduced bug" --json
devcore worktree rm --worktree id:<id> --force --json

关于选择器、setup flag、父/子 worktree 以及更完整的命令图谱,参见 DevCore CLI reference。

终端命令 ​

devcore terminal list --json
devcore terminal read --json
devcore terminal send --text "continue" --enter --json
devcore terminal wait --for tui-idle --timeout-ms 30000 --json
devcore terminal create --worktree path:/projects/app --command "npm test" --json
devcore terminal 拆分 --direction vertical --command "npm run dev" --json

对于需要跟踪的多 agent 工作,请使用 Orchestration 而非普通的终端 prompt。

文件命令 ​

从 shell 中在活动的 DevAgent worktree 里打开文件和 diff:

devcore file open src/App.tsx
devcore file diff src/App.tsx --staged
devcore file open-changed --mode both

当 shell 的当前目录不在目标 worktree 内时,使用 --worktree <selector>。

浏览器配置文件 ​

浏览器 profile 会隔离 标签页 的会话状态,因此脚本或 agent 可以用不同的 cookie、local storage 和已登录身份进行测试。CLI 在 devcore tab profile 下暴露 profile 命令;从 devcore tab profile list --json 开始,然后按需使用 create、set、clone 或 use-default。

计划自动化 ​

使用 devcore automations 从 shell 创建、检查、运行和移除计划的 DevAgent 任务。当你想让一个周期性 prompt 针对某个 repo 或已有 worktree 运行时,从 Scheduled automations 开始。

Artifacts ​

通过已登录的 DevAgent 账号将 HTML 或 Markdown 分享为公开查看链接(devcore artifacts share|update|list|delete)。发布是**选择加入(opt-in)**的,位于 设置 → Artifacts 下。命令详情:CLI reference → Artifacts。

浏览器自动化 ​

CLI 还能以 snapshot-interact-re-snapshot 循环来驱动内置浏览器:

devcore goto --url https://example.com --json
devcore snapshot --json     # 返回诸如 @e1、@e3 的 ref
devcore click --element @e3 --json
devcore fill --element @e1 --value "[email protected]" --json
devcore screenshot --json

对于响应式浏览器检查,将活动 标签页 切换到某个具名的设备 profile:

devcore set device --name "iPhone 12" --json
devcore screenshot --json

移动端 emulator ​

CLI 还能通过 DevAgent 的移动 emulator 桥接来驱动 iOS Simulator。它的作用范围限定于活动的 worktree,因此 agent 和脚本可以从 devcore emulator list 附着一个 simulator、点击归一化坐标、输入文本、发送手势、旋转设备,并在不离开 DevAgent 的情况下将其关闭。

devcore emulator list --json
devcore emulator attach "<device-name-or-udid>" --json
devcore emulator tap 0.5 0.7 --json
devcore emulator type "hello" --json
devcore emulator gesture '[{"type":"begin","x":0.5,"y":0.8},{"type":"move","x":0.5,"y":0.4},{"type":"end","x":0.5,"y":0.2}]' --json
devcore emulator rotate landscape_left --json
devcore emulator kill --json

当脚本需要一个明确的目标时,使用 --worktree <selector>、--device <udid-or-name> 或 --emulator <id>。

关于包括 标签页、wait、cookie 和 frame 在内的完整命令接口,参见 DevCore CLI reference,然后安装 DevCore CLI skill(参见 Skills registry),并让你的 agent 指向它。

DevAgent 桌面客户端文档