文档 / Cli / Orca CLI 概览
Orca CLI 是用于从任意 shell 脚本化运行中的 Orca 编辑器的 orca 命令行界面。使用它来创建和检查 worktree、驱动 agent 终端、打开文件和 diff、自动化内置浏览器、运行计划自动化、共享 HTML/Markdown 工件,并从脚本或 AI agent 控制 Orca 原生工具。
它随桌面应用一起提供;请在 设置 → 常规 → Orca CLI 下注册它。在 Linux 上,命令为 orca-ide,因为 GNOME Orca 的屏幕阅读器已经占用了 /usr/bin/orca — 参见 安装 → Linux。
Agent 可以使用以下命令安装对应的 Orca CLI 技能:
npx skills add https://github.com/stablyai/orca --skill orca-cli
# headless / no Settings UI:
orca skills install --skill orca-cli
有关所有可安装的 Orca 技能,包括 orca skills install / orca skills update,请参阅 技能注册表与 MCP。
安装与验证¶
Worktree 命令¶
orca worktree ps --json
orca worktree create --repo id:<repoId> --name my-task --issue 123 --json
orca worktree current --json
orca worktree set --worktree active --comment "reproduced bug" --json
orca worktree rm --worktree id:<id> --force --json
有关选择器、配置标志、父/子 worktree 以及更广泛的命令映射,请参阅 Orca CLI 参考。
终端命令¶
orca terminal list --json
orca terminal read --json
orca terminal send --text "continue" --enter --json
orca terminal wait --for tui-idle --timeout-ms 30000 --json
orca terminal create --worktree path:/projects/app --command "npm test" --json
orca terminal split --direction vertical --command "npm run dev" --json
对于需要跟踪的多 agent 工作,请使用 编排,而不是普通的终端提示。
文件命令¶
从 shell 在活动的 Orca worktree 中打开文件和 diff:
当 shell 的当前目录不在目标 worktree 内时,使用 --worktree <selector>。
浏览器配置文件¶
浏览器配置文件会隔离标签页会话状态,因此脚本或 agent 可以使用不同的 Cookie、本地存储和已登录身份进行测试。CLI 在 orca tab profile 下提供配置文件命令;先使用 orca tab profile list --json,然后根据需要执行 create、set、clone 或 use-default。
计划自动化¶
使用 orca automations 从 shell 创建、检查、运行和删除计划好的 Orca 任务。如果你希望周期性 prompt 针对某个 repo 或现有 worktree 运行,请从 计划自动化 开始。
工件¶
通过已登录的 Orca 账户将 HTML 或 Markdown 共享为公开查看链接(orca artifacts share|update|list|delete)。发布功能在 设置 → 工件 下为 opt-in。命令详情:CLI 参考 → 工件。
浏览器自动化¶
CLI 还通过快照-交互-重新快照循环驱动内置浏览器:
orca goto --url https://example.com --json
orca snapshot --json # returns refs like @e1, @e3
orca click --element @e3 --json
orca fill --element @e1 --value "user@example.com" --json
orca screenshot --json
对于响应式浏览器检查,将活动标签页切换到指定的设备配置文件:
移动模拟器¶
CLI 还可以通过 Orca 的移动模拟器桥接驱动 iOS 模拟器。它的作用范围限定在活动 worktree,因此 agent 和脚本可以从 orca emulator list 附加模拟器、点击归一化坐标、输入文本、发送手势、旋转设备并关闭它,而无需离开 Orca。
orca emulator list --json
orca emulator attach "<device-name-or-udid>" --json
orca emulator tap 0.5 0.7 --json
orca emulator type "hello" --json
orca 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
orca emulator rotate landscape_left --json
orca emulator kill --json
当脚本需要显式目标时,使用 --worktree <selector>、--device <udid-or-name> 或 --emulator <id>。
对于完整的命令界面,包括标签页、等待、Cookie 和框架,请参阅 Orca CLI 参考,然后安装 Orca CLI 技能(参见 技能 注册表),并将你的 agent 指向它。
本页原文 Markdown:在 AtomGit 查看·内容源自开源项目 orca48/orca