invoke-harness

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Invoke Harness

调用工具集

Run the selected harness as a bounded child process. Read only its reference:
  • Codex
  • Claude Code
  • Grok
  • OpenCode
  • Cursor CLI
  • GitHub Copilot CLI
  • Cockpit
以受限子进程的形式运行所选工具集。仅阅读其参考文档:
  • Codex
  • Claude Code
  • Grok
  • OpenCode
  • Cursor CLI
  • GitHub Copilot CLI
  • Cockpit

Procedure

步骤

  1. Resolve the harness's documented executable with
    command -v
    , then verify its identity and flags with current
    --version
    and
    --help
    output. Do not accept a binary merely because its filename matches: abort if its product identity or required flags do not match the selected harness. Local help may override flag names; it does not replace the reference's noninteractive agent command with another subcommand unless the user asked for that product feature.
  2. Use the harness's noninteractive mode. Set the model and working directory explicitly. Resolve nicknames to the CLI's actual model IDs. Start a fresh session unless the user requests continuation.
  3. Pass short prompts as one quoted argument. For long prompts, use the documented stdin or prompt-file method; never interpolate untrusted prompt text into shell syntax.
  4. External harness invocations always run without a harness sandbox and with all permissions bypassed. Use the exact no-sandbox/all-permissions flags in the selected reference. Do not substitute a restricted mode; abort if the installed harness lacks the required flags.
  5. Bound every child process with the harness's timeout option or the parent process runner's timeout. Capture stdout, stderr, and the exit status. Do not treat partial output, timeout, or a zero-finding review as success without checking the resulting files or diff.
This is intentionally unsafe: only invoke a harness in a directory and environment the user has placed in scope.
Before invoking Claude Code, warn the user that it consumes Claude usage credits. Treat Cockpit noninteractive mode as experimental until a harmless local smoke test succeeds.
  1. 使用
    command -v
    解析工具集文档中指定的可执行文件,然后通过当前的
    --version
    和
    --help
    输出来验证其标识和参数。不能仅因文件名匹配就接受二进制文件:如果产品标识或所需参数与所选工具集不匹配,则终止操作。本地帮助信息可覆盖参数名称;除非用户要求该产品功能,否则不得用其他子命令替代参考文档中的非交互代理命令。
  2. 使用工具集的非交互模式。明确设置模型和工作目录。将别名解析为CLI的实际模型ID。除非用户要求继续会话,否则启动新会话。
  3. 简短提示词作为单个带引号的参数传递。对于长提示词,使用文档中指定的标准输入或提示词文件方法;切勿将不可信的提示词文本插入到Shell语法中。
  4. 外部工具集调用始终在无工具集沙箱且绕过所有权限限制的情况下运行。使用所选参考文档中明确的无沙箱/全权限参数。不得替换为受限模式;如果已安装的工具集缺少所需参数,则终止操作。
  5. 通过工具集的超时选项或父进程运行器的超时限制每个子进程。捕获标准输出、标准错误和退出状态。在未检查生成的文件或差异的情况下,不得将部分输出、超时或零发现评审视为成功。
这是故意设计为不安全的:仅在用户指定范围内的目录和环境中调用工具集。
调用Claude Code之前,需提醒用户该工具会消耗Claude使用额度。在完成无害的本地冒烟测试之前,将Cockpit的非交互模式视为实验性功能。

Executables

可执行命令

Use only these product commands; aliases supplied by a different product do not count:
  • Codex:
    codex
  • Claude Code:
    claude
  • Grok:
    grok
    (never its compatibility alias
    agent
    )
  • OpenCode:
    opencode
  • Cursor CLI:
    agent
    ; reject it if help/version identifies Grok or lacks Cursor's required flags
  • GitHub Copilot CLI:
    copilot
  • Cockpit:
    cockpit
Cursor does not currently document
cursor
as its CLI executable. Because both Cursor and Grok can provide an
agent
command, identity verification is mandatory before invoking Cursor.
仅使用以下产品命令;其他产品提供的别名无效:
  • Codex:
    codex
  • Claude Code:
    claude
  • Grok:
    grok
    (切勿使用其兼容别名
    agent
    )
  • OpenCode:
    opencode
  • Cursor CLI:
    agent
    ;如果帮助/版本信息显示为Grok或缺少Cursor所需的参数,则拒绝使用
  • GitHub Copilot CLI:
    copilot
  • Cockpit:
    cockpit
Cursor目前未将
cursor
列为其CLI可执行文件。由于Cursor和Grok都可能提供
agent
命令,因此在调用Cursor之前必须进行身份验证。