第 23 卷
codex remote-control(实验)开启远程控制的后台服务:start / stop / pair(打印手机配对码)
codex app-server、 exec-(实验)给集成方用的服务进程
server
codex migrate-rollouts把旧的本地会话迁移到新的线程历史格式
codex debug调试工具
已经没有的: codex mcp-server(9月5日删除)。

codex --help 的前40行,本表的子命令清单以它为准。
全局参数
参数
-m,--model
-c,--config key=value
-p,--profile名字
-s,--sandbox
-a,--ask-for-approval
--approve-for-me
--dangerously-bypass-approvals-and-sandbox
- --yolo)
--dangerously-bypass-hook-trust
-C,--cd目录
--add-dir目录
--worktree
-i,--image文件…
--search
--enable/--disable功能
--strict-config
--no-alt-screen
--no-daemon
--oss、--local-provider 用途
指定模型,如gpt-6.1-sol、gpt-6-astra、gpt-6- luna
临时覆盖一项配置,如-c model_reasoning_effort=high
在基础配置上叠加~/.codex/名字.config.toml
read-only/workspace-write/danger-fullaccess
on-request/never
审批请求先交给自动审查(Auto-review)
跳过所有确认、不用沙盒,只在外面另有隔离时用
本次运行不要求hooks先被信任,只给已审过hook来源的自动化用
指定工作根目录
额外的可写目录
在一个新的受管git worktree里开会话
附带图片,可以给多个
开实时Web搜索
临时开关某个功能
配置有问题时直接报错
不占满屏幕,保留终端滚动历史
不连共享的后台服务
用本地开源模型
参数用途
--remote、 --remote-auth-token-env连远程的app-server
codex exec 另有: --json(输出JSONL事件)、 -o, --output-last-message 文件、 --output-schema 文
件、 --ephemeral(不落盘会话)、 --skip-git-repo-check、 --ignore-user-config、 --ignore-
rules。
已经失效的: --full-auto、 --api-key、 -a untrusted、 -a on-failure(§04有截图和替代写法)。