Codex CLI 配置教程¶
配置文件位置¶
- Mac/Linux:
~/.codex/config.toml - Windows:
C:\Users\你的用户名\.codex\config.toml
不生效?
如果不生效,可以尝试在当前工作空间 .codex 文件夹下,创建或覆盖配置文件 config.toml 和 auth.json。
Windows 配置¶
如果已经安装了 Codex CLI,直接编辑配置文件(没有就新建,存在就覆盖)。
config.toml¶
直接粘贴或覆盖为以下配置:
model = "gpt-5.3-codex"
model_reasoning_effort = "xhigh"
disable_response_storage = true
sandbox_mode = "danger-full-access"
windows_wsl_setup_acknowledged = true
approval_policy = "never"
profile = "auto-max"
file_opener = "vscode"
model_provider = "codex"
web_search = "cached"
suppress_unstable_features_warning = true
[history]
persistence = "save-all"
[tui]
notifications = true
[shell_environment_policy]
inherit = "all"
ignore_default_excludes = false
[sandbox_workspace_write]
network_access = true
[features]
plan_tool = true
apply_patch_freeform = true
view_image_tool = true
unified_exec = false
streamable_shell = false
rmcp_client = true
elevated_windows_sandbox = true
[profiles.auto-max]
approval_policy = "never"
sandbox_mode = "workspace-write"
[profiles.review]
approval_policy = "on-request"
sandbox_mode = "workspace-write"
[notice]
hide_gpt5_1_migration_prompt = true
[model_providers.codex]
name = "codex"
base_url = "https://api.yunxicodes.com"
wire_api = "responses"
requires_openai_auth = true
auth.json¶
直接粘贴或覆盖为以下配置:
配置完成后打开即可自动登录 Codex CLI。要更改模型只需修改 config.toml 第一行。
Mac / Linux 配置¶
配置方式与 Windows 完全一致,只是配置文件路径不同:
- 配置文件位于
~/.codex/config.toml和~/.codex/auth.json config.toml和auth.json的内容与上方 Windows 配置完全相同
注意事项¶
关于 5.3 模型
- 目前已支持 Codex 5.3 xhigh 系列,但由于还没全面推送,很多小伙伴的 Codex CLI 或插件无法直接选中这个模型
- 需要手动修改配置文件中的模型名称
- 修改之后无法自由切换模型,默认就是 5.3 xhigh
- 如果不小心切换到 5.2 了,修改 config.toml 第一行的模型名字换成
gpt-5.3-codex,重启终端或 VS Code 即可