orca-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOrca CLI
Orca CLI
Use this skill when the task should go through Orca's control plane rather than directly through , shell PTYs, or ad hoc filesystem access.
git当任务需要通过Orca的控制平面处理,而非直接通过、shell PTY或临时文件系统访问时,使用此技能。
gitWhen To Use
适用场景
Use for:
orca- worktree orchestration inside a running Orca app
- reading and replying to Orca-managed terminals
- stopping or waiting on Orca-managed terminals
- accessing repos known to Orca
Do not use when plain shell tools are simpler and Orca state does not matter.
orcaExamples:
- creating one Orca worktree per GitHub issue
- finding the Claude Code terminal for a worktree and replying to it
- checking which Orca worktrees have live terminal activity
orca- 运行中的Orca应用内的工作树编排
- 读取和回复Orca管理的终端
- 停止或等待Orca管理的终端
- 访问Orca已知的仓库
当普通shell工具更简单,且Orca状态不影响任务时,不要使用。
orca示例:
- 为每个GitHub issue创建一个Orca工作树
- 找到对应工作树的Claude Code终端并回复
- 检查哪些Orca工作树有活跃的终端活动
Preconditions
前置条件
- Prefer the public command first
orca - Orca editor/runtime should already be running, or the agent should start it with
orca open - Do not begin by inspecting Orca source files just to decide how to invoke the CLI. The first step is to check whether the installed command exists.
orca
First verify the public CLI is installed:
bash
command -v orcaThen use the public command:
bash
orca status --jsonIf the task is about Orca worktrees or Orca terminals, do this before any codebase exploration:
bash
command -v orca
orca status --jsonIf is not on PATH, say so explicitly and stop or ask the user to install/register the CLI before continuing.
orca- 优先使用公开的命令
orca - Orca编辑器/运行时应已启动,否则Agent需要通过启动它
orca open - 不要一开始为了确定如何调用CLI就去检查Orca源码文件,第一步应先检查是否已安装命令。
orca
首先验证公开CLI是否已安装:
bash
command -v orca然后使用公开命令:
bash
orca status --json如果任务涉及Orca工作树或Orca终端,请在探索代码库之前执行以下操作:
bash
command -v orca
orca status --json如果PATH中没有,请明确告知用户,停止操作或要求用户先安装/注册CLI后再继续。
orcaCore Workflow
核心工作流
- Confirm Orca runtime availability:
bash
orca status --jsonIf Orca is not running yet:
bash
orca open --json
orca status --json- Discover current Orca state:
bash
orca worktree ps --json
orca terminal list --json-
Resolve a target worktree or terminal handle.
-
Act through Orca:
worktree create/set/rmterminal read/send/wait/stop
- 确认Orca运行时可用:
bash
orca status --json如果Orca尚未运行:
bash
orca open --json
orca status --json- 查看当前Orca状态:
bash
orca worktree ps --json
orca terminal list --json-
解析目标工作树或终端句柄。
-
通过Orca执行操作:
worktree create/set/rmterminal read/send/wait/stop
Command Surface
命令接口
Repo
仓库相关
bash
orca repo list --json
orca repo show --repo id:<repoId> --json
orca repo add --path /abs/repo --json
orca repo set-base-ref --repo id:<repoId> --ref origin/main --json
orca repo search-refs --repo id:<repoId> --query main --limit 10 --jsonbash
orca repo list --json
orca repo show --repo id:<repoId> --json
orca repo add --path /abs/repo --json
orca repo set-base-ref --repo id:<repoId> --ref origin/main --json
orca repo search-refs --repo id:<repoId> --query main --limit 10 --jsonWorktree
工作树相关
bash
orca worktree list --repo id:<repoId> --json
orca worktree ps --json
orca worktree show --worktree id:<worktreeId> --json
orca worktree create --repo id:<repoId> --name my-task --issue 123 --comment "seed" --json
orca worktree set --worktree id:<worktreeId> --display-name "My Task" --json
orca worktree rm --worktree id:<worktreeId> --force --jsonWorktree selectors supported in focused v1:
id:<worktree-id>path:<absolute-path>branch:<branch-name>issue:<number>
bash
orca worktree list --repo id:<repoId> --json
orca worktree ps --json
orca worktree show --worktree id:<worktreeId> --json
orca worktree create --repo id:<repoId> --name my-task --issue 123 --comment "seed" --json
orca worktree set --worktree id:<worktreeId> --display-name "My Task" --json
orca worktree rm --worktree id:<worktreeId> --force --jsonv1聚焦版本支持的工作树选择器:
id:<worktree-id>path:<absolute-path>branch:<branch-name>issue:<number>
Terminal
终端相关
Use selectors to discover terminals, then use the returned handle for repeated live interaction.
bash
orca terminal list --worktree id:<worktreeId> --json
orca terminal show --terminal <handle> --json
orca terminal read --terminal <handle> --json
orca terminal send --terminal <handle> --text "continue" --enter --json
orca terminal wait --terminal <handle> --for exit --timeout-ms 5000 --json
orca terminal stop --worktree id:<worktreeId> --jsonWhy: terminal handles are runtime-scoped and may go stale after reloads. If Orca returns , reacquire a fresh handle with .
terminal_handle_staleterminal list使用选择器查找终端,然后使用返回的句柄进行后续的实时交互。
bash
orca terminal list --worktree id:<worktreeId> --json
orca terminal show --terminal <handle> --json
orca terminal read --terminal <handle> --json
orca terminal send --terminal <handle> --text "continue" --enter --json
orca terminal wait --terminal <handle> --for exit --timeout-ms 5000 --json
orca terminal stop --worktree id:<worktreeId> --json说明:终端句柄是运行时作用域的,重载后可能会失效。如果Orca返回,请通过重新获取新的句柄。
terminal_handle_staleterminal listAgent Guidance
Agent使用指南
- If the user says to create/manage an Orca worktree, use , not raw
orca worktree ....git worktree ... - Treat Orca as the source of truth for Orca worktree and terminal tasks. Do not mix Orca-managed state with ad hoc git worktree commands unless Orca explicitly cannot perform the requested action.
- Prefer for all machine-driven use.
--json - Use as the first summary view when many worktrees may exist.
worktree ps - Use to reacquire handles after Orca reloads.
terminal list - Use before
terminal readunless the next input is obvious.terminal send - Use only when the task actually depends on process completion.
terminal wait --for exit - Prefer Orca worktree selectors over hardcoded paths when Orca identity already exists.
- If the user asks for CLI UX feedback, test the public command first. Only inspect
orcaor usesrc/cliif the public command is missing or the task is explicitly about implementation internals.node out/cli/index.js - If a command fails, prefer retrying with the public command before concluding the CLI is broken, unless the failure already came from
orcaitself.orca
- 如果用户要求创建/管理Orca工作树,请使用,不要使用原生的
orca worktree ...。git worktree ... - 对于Orca工作树和终端任务,将Orca作为唯一可信数据源。不要混合使用Orca管理的状态和临时的git工作树命令,除非Orca明确无法执行请求的操作。
- 所有机器调用场景优先使用参数。
--json - 当存在大量工作树时,优先使用获取概览视图。
worktree ps - Orca重载后使用重新获取句柄。
terminal list - 在之前先执行
terminal send,除非下一步输入是明确的。terminal read - 仅当任务确实依赖进程完成时,才使用。
terminal wait --for exit - 当Orca中已存在身份标识时,优先使用Orca工作树选择器,而非硬编码路径。
- 如果用户要求CLI UX反馈,请先测试公开的命令。仅当公开命令缺失,或任务明确涉及实现内部细节时,才检查
orca或使用src/cli。node out/cli/index.js - 如果命令失败,优先重试公开的命令,再判定CLI损坏,除非失败本身就来自
orca命令。orca
Important Constraints
重要约束
- Orca CLI only talks to a running Orca editor.
- Terminal handles are ephemeral and tied to the current Orca runtime.
- in focused v1 supports only
terminal wait.--for exit - Orca is the source of truth for worktree/terminal orchestration; do not duplicate that state with manual assumptions.
- The public command is the interface users experience. Agents should validate and use that surface, not repo-local implementation entrypoints.
orca
- Orca CLI仅与运行中的Orca编辑器通信。
- 终端句柄是临时的,与当前Orca运行时绑定。
- v1聚焦版本的仅支持
terminal wait。--for exit - Orca是工作树/终端编排的唯一可信数据源;不要通过手动假设复制该状态。
- 公开的命令是用户实际使用的接口。Agent应验证并使用该接口,不要使用代码库本地的实现入口点。
orca
References
参考
See these docs in this repo when behavior is unclear:
docs/orca-cli-focused-v1-status.mddocs/orca-cli-v1-spec.mddocs/orca-runtime-layer-design.md
当行为不明确时,请查看代码库中的以下文档:
docs/orca-cli-focused-v1-status.mddocs/orca-cli-v1-spec.mddocs/orca-runtime-layer-design.md