Override any setting for a single run
configuration
// what it does
-c/--config sets any config.toml key for one run using TOML syntax, and CLI overrides win over profiles and the config file. Use dotted paths for nested tables (tui.theme, sandbox_workspace_write.network_access) and repeat -c for multiple keys.
// shell
$ codex -c sandbox_mode="read-only" "just review, do not touch anything"$ codex -c tui.theme="dark" "start with the dark theme"// gotcha
Values are parsed as TOML, so string values need quotes (model="gpt-5.6-terra") and nested keys use dots, not spaces. An unquoted string is read as a bare token and can fail.