codex
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCodex
Codex
Options and boundaries
选项与边界
Default: ; sandbox and model omitted;
parent wait 15m. Bare is an asked-for TUI.
"Use <model>" adds . A named sandbox adds .
"Worktree" adds boolean , never a name or invented path.
"Review" selects . Missing values or conflicts are .
codex exec -C <abs-dir> "<prompt>"codex-m--sandbox <mode>--worktreecodex reviewBLOCKEDSandbox read-only constrains model-generated shell, not the whole process.
Workspace-write is not auto-approve. is rejected.
and are global, before .
Skip-git-repo-check needs an explicit request; do not initialize a repo to
evade the check. Named waivers are required for bypass-approvals-and-sandbox,
bypass-hook-trust, danger-full-access, approve-for-me, approval never, yolo,
and ignore-rules. Before a waiver or on sandbox failure, apply
; failure does not authorize a bypass.
--full-auto--search--ask-for-approvalexecreferences/sandbox.md默认命令:;省略sandbox与model参数;父进程等待15分钟。仅执行裸命令会启动TUI(需用户主动调用)。
“使用<model>”会添加参数。指定名称的sandbox会添加参数。
“Worktree”相关请求会添加布尔型参数,绝不传入名称或虚构路径。
“Review”相关请求会调用。参数缺失或冲突时返回。
codex exec -C <abs-dir> "<prompt>"codex-m--sandbox <mode>--worktreecodex reviewBLOCKEDsandbox只读模式限制的是模型生成的shell命令,而非整个进程。工作区写入不等于自动批准。参数会被拒绝。
和是全局参数,需放在之前。
跳过git仓库检查需要用户明确请求;不得通过初始化仓库来规避检查。
以下操作需要使用命名waiver:bypass-approvals-and-sandbox、bypass-hook-trust、danger-full-access、approve-for-me、approval never、yolo、ignore-rules。
在申请waiver或sandbox运行失败时,需遵循的规定;失败不代表可以绕过限制。
--full-auto--search--ask-for-approvalexecreferences/sandbox.md1. Resolve
1. 解析
Fix workspace, prompt, mode, session, worktree, sandbox, and wait.
Check binary and without exposing secrets.
Missing binary → follow ; missing auth →
unless login was requested. Omit sandbox unless the user named it.
Record .
Done when target, binary, auth, and authorized options are fixed.
codex login statusreferences/install.mdBLOCKEDcmd | workspace | mode | session | worktree | waiver | wait | evidence | terminal确定workspace、prompt、mode、session、worktree、sandbox和wait参数。
检查二进制文件与命令输出,不得泄露密钥。
二进制文件缺失 → 遵循操作;认证信息缺失 → 返回,除非用户明确请求登录。
除非用户指定sandbox,否则省略该参数。
记录以下字段:。
当目标目录、二进制文件、认证信息和授权选项全部确定后,本步骤完成。
codex login statusreferences/install.mdBLOCKEDcmd | workspace | mode | session | worktree | waiver | wait | evidence | terminal2. Run
2. 运行
Build argv, quote the prompt literally, and use for the target.
Default text is 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 .
-CBLOCKEDFor JSONL/last-message output, follow .
For resume/fork, follow .
For worktrees/parallel runs, follow .
For review, TUI, login, MCP, or plugins, follow .
On a rejected flag, use scoped or .
Done when the process exits or a named failure/authorization gate is reported.
references/streaming.mdreferences/sessions.mdreferences/worktrees.mdreferences/management.mdcodex --helpcodex exec --help构建argv参数数组,原样转义prompt内容,使用参数指定目标目录。
默认模式下进程退出前无额外输出;无输出不代表进程挂起。等待进程退出或达到记录的截止时间;截止时间到后仅终止本次运行的PID。
非零退出码:捕获stderr输出,检查目录树,报告。
-CBLOCKED如需JSONL/last-message格式输出,遵循的规定。
如需恢复/分叉会话,遵循的规定。
如需worktree/并行运行,遵循的规定。
如需review、TUI、登录、MCP或插件管理,遵循的规定。
遇到被拒绝的参数时,使用对应范围的或查看帮助。
当进程退出,或报告指定的失败/授权门禁触发时,本步骤完成。
references/streaming.mdreferences/sessions.mdreferences/worktrees.mdreferences/management.mdcodex --helpcodex exec --help3. Verify and report
3. 验证与报告
Inspect status and diff; CLI text is unverified. Run the narrowest covering
tests for edited executable code. Check every child worktree; read-only
sandbox is not a tree-unchanged guarantee. Remove only clean worktrees this
run created and the user did not ask to keep; preserve login, MCP, plugins.
Report command, mode, session/worktree, waiver, wait, and outcome evidence.
Done when every requested outcome is observed or a blocker is evidenced.
Terminals: , , , .
SUCCESSNO_CHANGESBLOCKEDAWAITING_USER检查状态和diff;CLI输出文本不做验证。针对编辑过的可执行代码,运行覆盖范围最小的测试用例。检查每个子worktree;只读sandbox不保证目录树未被修改。仅删除本次运行创建的、用户未要求保留的干净worktree;保留登录信息、MCP配置和插件。
报告命令、mode、session/worktree、waiver、wait和结果证据。
当所有请求的结果都已观测到,或已证实存在阻塞项时,本步骤完成。
终止状态:、、、。
SUCCESSNO_CHANGESBLOCKEDAWAITING_USER