cursor-agent

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Cursor Agent

Cursor Agent

Options and boundaries

选项与边界

Default:
cursor-agent --print --workspace <abs-dir> "<prompt>"
, mode/model omitted, text output, parent wait 15m. Print alone can write. "Plan" / "read-only plan" adds
--plan
; "ask" / "Q&A" adds
--mode ask
. Both block. "Use <model>" adds
--model
. "Interactive" / "TUI" omits print. "Resume <id>" adds
--resume
; "continue" adds
--continue
; both block. "Worktree [name]" adds
--worktree [name]
; record the printed path. "JSON" / "stream-json" selects that print format. Ambiguity is
BLOCKED
.
Workspace trust needs the user's named authorization for this run; a coding request is not trust. On
Workspace Trust Required
, or before
--trust
, apply
references/trust-integrations.md
. Trust recovery adds only an authorized
--trust
, not force/yolo. Force, sandbox disabled, approve-mcps, and worker desktop/credential controls need their own named waivers. Auto-review is explicit opt-in, not a trust or permission bypass.
默认用法:
cursor-agent --print --workspace <abs-dir> "<prompt>"
, 省略模式/模型,文本输出,父进程等待15分钟。仅print模式可写入。 “计划”/“只读计划”模式添加
--plan
参数;“询问”/“问答”模式添加
--mode ask
参数。 两者均为阻塞式。“使用<模型>”添加
--model
参数。“交互式”/“TUI”模式省略print参数。 “恢复<id>”添加
--resume
参数;“继续”添加
--continue
参数;两者均为阻塞式。 “工作树[名称]”添加
--worktree [name]
参数;记录打印输出的路径。 “JSON”/“流式JSON”选择对应的打印格式。存在歧义时返回
BLOCKED
。
工作区信任需要用户针对本次运行的显式授权;编码请求不代表信任。 出现
Workspace Trust Required
提示时,或在使用
--trust
参数之前, 需遵循
references/trust-integrations.md
的规定。信任恢复仅添加已授权的
--trust
参数, 不得使用强制/YOLO模式。强制模式、沙箱禁用、approve-mcps 以及worker桌面/凭证控制均需要各自的显式豁免。 自动审查需用户显式开启,不得绕过信任或权限。

1. Resolve

1. 解析

Fix workspace, prompt, mode, session/worktree, output, and wait. Check binary and
cursor-agent status --format json
without exposing secrets. Missing binary → follow
references/install.md
; missing auth →
BLOCKED
unless login was requested. Resolve trust before running. Record
cmd | workspace | mode | session | worktree | trust | waiver | wait | evidence | terminal
. Done when target, binary, auth, trust, and authorized options are fixed.
确定工作区、提示词、模式、会话/工作树、输出方式和等待时长。 检查二进制文件并执行
cursor-agent status --format json
命令,不得泄露密钥。 缺少二进制文件→遵循
references/install.md
的指引;缺少授权→返回
BLOCKED
除非用户请求了登录操作。运行前先完成信任解析。 记录以下字段:
cmd | workspace | mode | session | worktree | trust | waiver | wait | evidence | terminal
。 当目标、二进制文件、授权、信任状态和已授权选项均确定后,本阶段完成。

2. Run

2. 运行

Build argv and quote the prompt literally. Text/json may be quiet until exit; silence is not a hang. Wait until exit or the recorded deadline; kill only this run's PID at that deadline. Nonzero exit: capture stderr, inspect the tree, report
BLOCKED
, not a retry with added force.
For JSON/stream output, follow
references/streaming.md
. For resume, continue, or persist, follow
references/sessions.md
. For worktrees/parallel runs, follow
references/worktrees.md
. For a TUI or other command syntax, follow
references/management.md
. For login, MCP, plugins, workers, or Bedrock, apply the matching branch in
references/trust-integrations.md
. On rejected syntax, use scoped
--help
. Done when the process exits, an intended live session is recorded, or an authorization gate/failure is reported.
构建argv参数数组,并按字面意思引用提示词。text/json模式在进程退出前可能无输出; 无输出不等于进程挂起。等待进程退出或达到记录的截止时间; 截止时间到后仅终止本次运行的PID。非零退出码:捕获stderr输出, 检查目录树结构,报告
BLOCKED
,不得添加强制参数重试。
对于JSON/流式输出,遵循
references/streaming.md
的指引。 对于恢复、继续或持久化会话,遵循
references/sessions.md
的指引。 对于工作树/并行运行,遵循
references/worktrees.md
的指引。 对于TUI或其他命令语法,遵循
references/management.md
的指引。 对于登录、MCP、插件、workers或Bedrock,应用
references/trust-integrations.md
中对应的分支规则。 遇到不被接受的语法时,使用对应作用域的
--help
命令。 当进程退出、预期的活动会话已记录,或已报告授权门槛触发/授权失败时,本阶段完成。

3. Verify and report

3. 验证与报告

Inspect status and diff; CLI text is unverified. Run the narrowest covering tests for edited executable code. Plan/ask must leave the tree unchanged. Check each worktree and any integrated tree. Clean up only sessions and clean worktrees this run created unless kept; preserve shell integration, MCP, plugins, and workers. Report command, mode, session/worktree, waivers, wait, and outcome evidence. Done when each outcome is observed or blocked with evidence.
Terminals:
SUCCESS
,
NO_CHANGES
,
BLOCKED
,
AWAITING_USER
.
检查运行状态和diff结果;CLI的文本输出不做验证。 针对编辑过的可执行代码运行最小范围的覆盖测试。计划/询问模式必须保持目录树不变。 检查每个工作树以及所有集成的目录树。仅清理本次运行创建的会话和干净的工作树(除非要求保留); 保留shell集成、MCP、插件和workers。报告命令、模式、会话/工作树、豁免情况、等待时长和结果证据。 当每个结果都已确认,或已附带证据标记为阻塞时,本阶段完成。
终止状态:
SUCCESS
、
NO_CHANGES
、
BLOCKED
、
AWAITING_USER
。