cline-delegate
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCline Delegate
Cline 任务委托
You are the orchestrator. Delegate a bounded coding task to a separate implementer - the Cline
coding agent CLI - then review what it produced and land it yourself. You write the brief and own
the judgment; the implementer makes changes in its own session in a clean working tree; you verify
and commit.
The loop needs only a shell command and file access, so any comparable orchestrator can drive it.
你是协调者。将一个边界明确的编码任务委托给独立的实现者——Cline编码代理CLI,然后审查其产出并自行完成提交。你编写任务简报并负责判断;实现者在独立会话的干净工作目录中进行修改;你负责验证并提交。
这个循环只需要shell命令和文件访问权限,因此任何类似的协调工具都可以驱动它。
When NOT to use this
何时不使用此方法
- The task is small enough to do inline; delegation overhead is not worth it.
- The CLI is not installed or authenticated.
cline - You require the relay to configure a sandbox. Cline exposes sandbox controls, but this relay
leaves them to the CLI environment; use when the run must be read-only.
--plan
- 任务足够小,可以直接完成;委托的开销得不偿失。
- 未安装或未认证CLI。
cline - 你需要中继配置沙箱。Cline提供沙箱控制,但此中继将其留给CLI环境;当运行必须为只读时,请使用参数。
--plan
Prerequisites (check once)
前提条件(检查一次)
- Install (npm or bundled binary; the relay probes
cline).cline --version - Authenticate: run (interactive sign-in), or configure
cline auth/ an OpenAI-compatible base URL.ANTHROPIC_API_KEY - Confirm succeeds.
cline --version - Work in, or point at, the target git repository.
--cd
- 安装(通过npm或捆绑二进制文件;中继会探测
cline)。cline --version - 认证:运行(交互式登录),或配置
cline auth/ 兼容OpenAI的基础URL。ANTHROPIC_API_KEY - 确认执行成功。
cline --version - 在目标git仓库中工作,或通过参数指向该仓库。
--cd
Choose the model (optional)
选择模型(可选)
Cline picks a default model. To choose another, pass the separate or
(e.g. , , ). The relay accepts letters, digits,
and only (the value reaches a shell on Windows).
--model <id>--provider <name>anthropicopenai-nativeopenrouter. _ : / -Cline会选择默认模型。要选择其他模型,请传递独立的或参数(例如、、)。中继仅接受字母、数字以及字符(该值会传递到Windows系统的shell中)。
--model <id>--provider <name>anthropicopenai-nativeopenrouter. _ : / -The loop
操作循环
Run these five steps per task. Steps 1, 4, and 5 require judgment; 2 and 3 are mechanical.
每个任务执行以下五个步骤。步骤1、4和5需要判断;步骤2和3是机械操作。
1. Write a brief
1. 编写任务简报
Cline sees only the text you send. It cannot read your conversation: the brief must stand alone
with the goal, current state, what to change, what to leave untouched, the project's real
gates, and a report contract. Keep each brief to a single task. Write it to a file and pass it as
the relay's . See references/writing-the-brief.md.
--briefCline只能看到你发送的文本。它无法读取你的对话:任务简报必须独立包含目标、当前状态、需要修改的内容、需要保留的内容、项目的实际准入标准以及报告约定。每个简报仅对应一个任务。将简报写入文件,并作为中继的参数传递。请参阅references/writing-the-brief.md。
--brief2. Dispatch
2. 分发任务
Use the bundled relay. It runs , streams the brief on stdin behind a fixed
positional instruction, captures the JSON event stream, and writes .
cline --json -vresult.jsonbash
node "<skill-dir>/scripts/relay.mjs" --brief brief.txt --cd /path/to/repo使用捆绑的中继工具。它会运行,在固定的位置指令后通过标准输入流传输简报,捕获JSON事件流,并写入文件。
cline --json -vresult.jsonbash
node "<skill-dir>/scripts/relay.mjs" --brief brief.txt --cd /path/to/repochoose a model / provider: add --model <id> --provider <name>
选择模型/提供商: 添加 --model <id> --provider <name>
read-only planning pass: add --plan (forces --auto-approve false)
只读规划阶段: 添加 --plan (强制设置 --auto-approve false)
deny approval-required tools: add --auto-approve false
禁用需要审批的工具: 添加 --auto-approve false
hard time limit (watchdog): add --timeout 2h (the 30m default suits brief runs; most implementation briefs should be 1-2h)
硬超时限制(监控): 添加 --timeout 2h (默认30分钟适合简短运行;大多数实现类简报应设置为1-2小时)
see all options: node .../relay.mjs --help
查看所有选项: node .../relay.mjs --help
The child's cwd pins the workspace. The relay writes artifacts under the system temp dir by
default and never commits. See [references/dispatch-and-poll.md](references/dispatch-and-poll.md).
子进程的当前工作目录固定为工作区。中继默认将产物写入系统临时目录,且绝不会自动提交。请参阅[references/dispatch-and-poll.md](references/dispatch-and-poll.md)。3. Wait for completion
3. 等待完成
The relay blocks until cline finishes. Run it with the orchestrator's background-command
facility, or background it in the shell and poll for . A pre-run usage error exits 2
and writes no result; a missing exits 127 and writes .
result.jsonclinestatus: "cline_unavailable"Completion means the process exited and exists - trust process state and the
working tree, not the progress display. Cline's final message is the field of
.
result.jsonfinalMessageresult.json中继会阻塞直到cline完成运行。可以通过协调者的后台命令功能运行它,或者在shell中将其置于后台并轮询文件是否存在。预运行时的使用错误会以状态码2退出,且不会写入结果;若未找到,则以状态码127退出,并写入。
result.jsonclinestatus: "cline_unavailable"完成意味着进程已退出且存在——请信任进程状态和工作目录,而非进度显示。Cline的最终消息位于的字段中。
result.jsonresult.jsonfinalMessage4. Review - do not trust the self-report
4. 审查——不要信任自我报告
- Re-run the project's gates yourself.
- Read the diff against the brief, starting with .
touchedFiles - Run relevant guard skills if installed.
See references/review-and-land.md.
- 自行重新运行项目的准入检查。
- 根据任务简报阅读差异,从开始。
touchedFiles - 若已安装相关防护工具,请运行它们。
请参阅references/review-and-land.md。
5. Land it
5. 完成提交
If the work is good, commit it. The relay never commits - the diff and are the
record; run and first to confirm exactly what changed. If the group has a
PR flow, make the commit and push a branch; let human review happen. If the diff is wrong or
incomplete, re-dispatch a corrected brief in a fresh run and review again.
result.jsongit statusgit diff如果工作成果合格,提交代码。中继绝不会自动提交——差异文件和是记录;请先运行和来确认具体的变更内容。如果团队采用PR流程,请提交代码并推送分支;交由人工审查。如果差异不正确或不完整,请在新的运行中分发修正后的简报并再次审查。
result.jsongit statusgit diffAutonomy and permissions
自主性与权限
The relay explicitly passes Cline's , defaulting to in act mode. Cline
plan mode can request a switch to act mode, so forces ; the relay
rejects . That pair is the read-only gate. Cline also exposes sandbox
through / , but the relay does not configure or override it. Plan-first
for anything risky, then review the plan before a separate act-mode dispatch. Malformed or malicious
briefs remain dangerous in act mode because commands run as the current user.
--auto-approvetrue--plan--auto-approve false--plan --auto-approve true--data-dirCLINE_SANDBOX中继会显式传递Cline的参数,在操作模式下默认值为。Cline的规划模式可以请求切换到操作模式,因此参数会强制设置;中继会拒绝的组合。这对参数是只读准入控制。Cline还通过 / 提供沙箱控制,但中继不会配置或覆盖它。对于任何有风险的操作,请先进行规划,然后在单独的操作模式分发前审查规划内容。在操作模式下,格式错误或恶意的简报仍然具有危险性,因为命令会以当前用户身份运行。
--auto-approvetrue--plan--auto-approve false--plan --auto-approve true--data-dirCLINE_SANDBOXAuthorization model
授权模型
Delegation is something the human opts into. Once briefed, cline works as a tool you approved use
of. The boundary is: do not accept conclusions from the self-report; verify everything on
disk. For anything touching credentials, production data, or irreversible operations, stop and ask
the human first instead of encoding it in a brief.
委托是用户主动选择的操作。一旦收到简报,cline会作为你批准使用的工具工作。边界是:不要接受自我报告中的结论;请验证磁盘上的所有内容。对于任何涉及凭证、生产数据或不可逆操作的任务,请先停止并询问用户,而非将其编码到简报中。
References
参考资料
- references/writing-the-brief.md - structure, scope, gates, brief delivery.
- references/dispatch-and-poll.md - flags, artifacts,
, and failure recovery.
result.json - references/review-and-land.md - what to verify before calling the diff done, at the end of a run.
- references/multi-task-queues.md - sequential queues, constraint carry-forward, progress tracking, and the final coherence pass.
- references/writing-the-brief.md - 结构、范围、准入标准、简报交付。
- references/dispatch-and-poll.md - 标志、产物、以及故障恢复。
result.json - references/review-and-land.md - 在运行结束时,确认差异完成前需要验证的内容。
- references/multi-task-queues.md - 顺序队列、约束传递、进度跟踪以及最终一致性检查。