Terminal CLI Commands and Options
All 29 official Codex CLI command entries, global and command-specific option tables, and release additions
Written and reviewed by Eric Han · Co-founder & CTO, reopt
Key takeaways
- Includes 29 official command entries and scoped option tables.
- Separates release additions such as
--no-daemon, automatic daemon startup,--oauth-client-secret, and--cyber-access-programthrough CLI 0.163.0.
Checked against the CLI tables in Developer Commands on October 23, 2026: 29 command entries plus global and command-specific option tables. Values below are documented types, accepted values, or argument forms; replace placeholders and check codex <command> --help before running. Release additions through 0.163.0 appear separately below.
Slash commands · Developer Commands
29 terminal commands
| Command | Use |
|---|---|
codex | Interactive TUI |
codex agents | Stable · command center on a local or remote server |
codex app | Launch the desktop app |
codex app-server | Integration server; experimental |
codex apply | Apply a cloud diff |
codex archive | Archive a saved session |
codex cloud | Inspect/run cloud tasks; experimental |
codex completion | Generate shell completions |
codex debug app-server send-message-v2 | Diagnose a V2 protocol request |
codex debug models | Model catalog JSON |
codex debug prompt-input | Model-visible prompt JSON |
codex delete | Permanently delete a session |
codex doctor | Installation/config/runtime diagnostics |
codex exec | Non-interactive task |
codex execpolicy | Evaluate execution rules; preview |
codex features | Inspect/persist feature flags |
codex fork | Fork a saved session |
codex login | Account/API authentication |
codex logout | Clear saved authentication |
codex mcp | Manage external MCP servers |
codex plugin | Manage plugins |
codex plugin marketplace | Manage marketplace sources |
codex queue | Stable · queue a message by UUID or exact session name |
codex remote-control | Remote daemon/pairing; experimental |
codex resume | Resume a conversation |
codex review | Non-interactive code review |
codex sandbox | Execute within an OS sandbox |
codex unarchive | Restore an archived session |
codex update | Self-update supported release builds |
Global options
| Key | Type, value, or arguments |
|---|---|
--add-dir | path |
--approve-for-me, --not-so-yolo | boolean |
--ask-for-approval, -a | on-request | never |
--cd, -C | path |
--config, -c | key=value |
--dangerously-bypass-approvals-and-sandbox, --yolo | boolean |
--dangerously-bypass-hook-trust | boolean |
--disable | feature |
--enable | feature |
--image, -i | path[,path...] |
--local-provider | lmstudio | ollama |
--model, -m | string |
--no-alt-screen | boolean |
--no-daemon | boolean |
--oss | boolean |
--profile, -p | string |
--remote | ws://host:port | wss://host:port | unix:// | unix://PATH |
--remote-auth-token-env | ENV_VAR |
--sandbox, -s | read-only | workspace-write | danger-full-access |
--search | boolean |
--strict-config | boolean |
--worktree | boolean |
PROMPT | string |
--profile layers $CODEX_HOME/<profile>.config.toml. --remote-auth-token-env requires --remote and sends tokens only over WSS or local WS. --search selects live rather than cached search. --strict-config rejects unknown settings.
codex app-server
| Key | Type, value, or arguments |
|---|---|
--analytics-default-enabled | boolean |
--code-mode-host | ws://HOST/PATH | wss://HOST/PATH |
--listen | stdio:// | ws://IP:PORT | unix:// | unix://PATH | off |
--stdio | boolean |
--ws-audience | string |
--ws-auth | capability-token | signed-bearer-token |
--ws-issuer | string |
--ws-max-clock-skew-seconds | number |
--ws-shared-secret-file | absolute path |
--ws-token-file | absolute path |
--ws-token-sha256 | hexadecimal SHA-256 digest |
Do not combine --stdio with --listen. Signed-bearer-token authentication requires --ws-shared-secret-file. --code-mode-host is a separate outbound connection.
codex app
| Key | Type, value, or arguments |
|---|---|
--download-url | url |
PATH | path |
codex debug app-server send-message-v2
| Key | Type, value, or arguments |
|---|---|
USER_MESSAGE | string |
codex debug models
| Key | Type, value, or arguments |
|---|---|
--bundled | boolean |
--bundled inspects the binary’s catalog without a remote refresh.
codex debug prompt-input
| Key | Type, value, or arguments |
|---|---|
--image, -i | path[,path...] |
PROMPT | string |
Inspect the output before sharing: it contains model-visible instructions and context.
codex apply
| Key | Type, value, or arguments |
|---|---|
TASK_ID | string |
codex review
| Key | Type, value, or arguments |
|---|---|
--base | branch |
--commit | SHA |
--strict-config | boolean |
--title | string |
--uncommitted | boolean |
PROMPT | string | - (read stdin) |
Choose exactly one of --uncommitted, --base, --commit, or a custom PROMPT. Use --title with --commit.
codex archive and codex unarchive
| Key | Type, value, or arguments |
|---|---|
--remote | ws://host:port | wss://host:port | unix:// | unix://PATH |
--remote-auth-token-env | ENV_VAR |
SESSION | session ID | session name |
codex delete
| Key | Type, value, or arguments |
|---|---|
--force | boolean |
--remote | ws://host:port | wss://host:port | unix:// | unix://PATH |
--remote-auth-token-env | ENV_VAR |
SESSION | session ID | session name |
--force applies only to session UUIDs. Named deletion still requires confirmation.
codex cloud
| Key | Type, value, or arguments |
|---|---|
--attempts | 1-4 |
--env | ENV_ID |
QUERY | string |
This table describes task submission with codex cloud exec.
codex cloud list
| Key | Type, value, or arguments |
|---|---|
--cursor | string |
--env | ENV_ID |
--json | boolean |
--limit | 1-20 |
codex completion
| Key | Type, value, or arguments |
|---|---|
SHELL | bash | zsh | fish | power-shell | elvish |
codex doctor
| Key | Type, value, or arguments |
|---|---|
--all | boolean |
--ascii | boolean |
--json | boolean |
--no-color | boolean |
--summary | boolean |
codex features
| Key | Type, value, or arguments |
|---|---|
Disable subcommand | codex features disable <feature> |
Enable subcommand | codex features enable <feature> |
List subcommand | codex features list |
Enable/disable persist in configuration. This command does not accept --profile.
codex exec
| Key | Type, value, or arguments |
|---|---|
--approve-for-me, --not-so-yolo | boolean |
--cd, -C | path |
--color | always | never | auto |
--dangerously-bypass-approvals-and-sandbox, --yolo | boolean |
--dangerously-bypass-hook-trust | boolean |
--ephemeral | boolean |
--ignore-rules | boolean |
--ignore-user-config | boolean |
--image, -i | path[,path...] |
--json, --experimental-json | boolean |
--local-provider | lmstudio | ollama |
--model, -m | string |
--oss | boolean |
--output-last-message, -o | path |
--output-schema | path |
--profile, -p | string |
--sandbox, -s | read-only | workspace-write | danger-full-access |
--skip-git-repo-check | boolean |
--worktree | boolean |
-c, --config | key=value |
PROMPT | string | - (read stdin) |
Resume subcommand | codex exec resume [SESSION_ID] |
--json emits JSONL events, --output-last-message writes the final reply, and --output-schema specifies its schema. The current official codex exec table no longer lists --full-auto, matching its removal in 0.147.0. New examples use explicit --sandbox workspace-write.
codex exec resume
| Key | Type, value, or arguments |
|---|---|
--all | boolean |
--image, -i | path[,path...] |
--last | boolean |
PROMPT | string | - (read stdin) |
SESSION_ID | uuid | session name |
--last scopes selection to the current directory; --all searches across directories.
codex execpolicy
| Key | Type, value, or arguments |
|---|---|
--pretty | boolean |
--rules, -r | path (repeatable) |
COMMAND... | var-args |
codex login
| Key | Type, value, or arguments |
|---|---|
--device-auth | boolean |
--with-access-token | boolean |
--with-api-key | boolean |
status subcommand | codex login status |
Supply API keys and access tokens via stdin, not argument values. status exits 0 when logged in.
codex mcp
| Key | Type, value, or arguments |
|---|---|
add <name> | -- <command...> | --url <value> |
get <name> | --json |
list | --json |
login <name> | --scopes scope1,scope2 |
logout <name> | — |
remove <name> | — |
OAuth login/logout apply only to streamable HTTP servers that support OAuth.
codex mcp add
| Key | Type, value, or arguments |
|---|---|
--bearer-token-env-var | ENV_VAR |
--env KEY=VALUE | repeatable |
--oauth-client-id | CLIENT_ID |
--oauth-resource | RESOURCE |
--url | https://… |
COMMAND... | stdio transport |
Do not combine --url with stdio COMMAND.... OAuth client/resource options require --url.
codex plugin
| Key | Type, value, or arguments |
|---|---|
add <plugin[@marketplace]> | [--marketplace, -m NAME] [--json] |
list | [--marketplace, -m NAME] [--available --json] [--json] |
marketplace | — |
remove <plugin[@marketplace]> | [--marketplace, -m NAME] [--json] |
list --available requires --json; the JSON includes installed and available arrays.
codex plugin marketplace
| Key | Type, value, or arguments |
|---|---|
add <source> | [--ref REF] [--sparse PATH] [--json] |
list | [--json] |
remove <marketplace-name> | [--json] |
upgrade [marketplace-name] | [--json] |
--sparse is repeatable and applies only to Git sources.
codex resume
| Key | Type, value, or arguments |
|---|---|
--all | boolean |
--include-non-interactive | boolean |
--last | boolean |
SESSION_ID | uuid | session name |
Persist the directory choice with tui.resume_cwd; explicit --cd takes precedence.
codex fork
| Key | Type, value, or arguments |
|---|---|
--all | boolean |
--last | boolean |
SESSION_ID | uuid |
macOS seatbelt
| Key | Type, value, or arguments |
|---|---|
--allow-unix-socket | path |
--cd, -C | DIR |
--config, -c | key=value |
--include-managed-config | boolean |
--log-denials | boolean |
--permission-profile, -P | NAME |
--profile, -p | NAME |
COMMAND... | var-args |
--cd and --include-managed-config require --permission-profile. --allow-unix-socket is macOS-specific.
Linux sandbox
| Key | Type, value, or arguments |
|---|---|
--cd, -C | DIR |
--config, -c | key=value |
--include-managed-config | boolean |
--permission-profile, -P | NAME |
--profile, -p | NAME |
COMMAND... | var-args |
--cd and --include-managed-config require --permission-profile.
Windows
| Key | Type, value, or arguments |
|---|---|
--cd, -C | DIR |
--config, -c | key=value |
--include-managed-config | boolean |
--permission-profile, -P | NAME |
--profile, -p | NAME |
COMMAND... | var-args |
--cd and --include-managed-config require --permission-profile.
Current options and compatibility in 0.163.0
--approve-for-me (--not-so-yolo) uses automatic approval review with on-request approvals and workspace-write sandboxing. It conflicts with --sandbox and --yolo; interactive CLI also rejects --ask-for-approval. --worktree requires local execution and in exec cannot combine with resume, review, --ephemeral, or --ignore-user-config. --no-daemon conflicts with --remote and codex agents. The overview now lists codex agents and codex queue; Linux sandbox documentation uses bubblewrap and seccomp.
Daybreak defaults on for eligible accounts in 0.163.0. The 0.161.0 opt-in notes below are historical. Searchable /config, the Ctrl+X leader, F9 mute, and /daemon restart follow the 0.163.0 release.
Release additions and compatibility
| Command | Scope |
|---|---|
codex exec --cyber-access-program | 0.161.0 per-turn Cyber access program selection; works with cli_daybreak disabled |
codex --enable cli_daybreak | 0.161.0 opt-in for Daybreak controls and automatic Cyber routing |
codex mcp add --oauth-client-secret | 0.158.0 client secret for a pre-registered OAuth client; use with --oauth-client-id |
codex --no-daemon | 0.156.0 launch without the shared background server |
codex app-server daemon update | 0.155.0 daemon update |
codex agents / codex queue | 0.149–150 agent/queue operations |
codex exec fork | 0.147–148 non-interactive fork |
codex remote-control / codex remote-control start / codex remote-control stop / codex remote-control pair | Remote foreground/daemon/pairing; supports --json |
codex mcp-server | Removed; see codex app-server |
0.155.0 adds daemon update schedules and recovery of threads/goals after restarts. codex update updates the CLI installation; daemon update targets the daemon. Check installed help for platform/install-specific sub-options.
0.156.0 adds the in-session /daemon menu and --no-daemon to bypass the shared background server. From 0.157.0, eligible interactive sessions start the background server automatically and offer recovery choices when server settings are incompatible. Neither appears in the official CLI tables yet.
0.158.0 adds codex mcp add --oauth-client-secret. It requires a nonempty secret together with a client ID, stores the value as oauth.client_secret in the server configuration, and redacts it in debug output. It is not in the official codex mcp add option table yet. The official --model example now reads gpt-6.1-sol, and from 0.159.1 a session without a configured model uses the bundled default, GPT-6.1 Sol.
0.161.0 adds codex exec --cyber-access-program. According to the pull-request description the values are standard, daybreak_blue, and daybreak_red, and the flag is rejected for review and for forks without a prompt. The selection applies to that turn only and leaves the saved choice unchanged. The same release makes Daybreak opt-in: without --enable cli_daybreak or features.cli_daybreak = true, Daybreak controls, /daybreak, and automatic Cyber routing stay off. Neither appears in the official CLI tables or the non-interactive docs yet.
codex doctor --summary
codex debug models --bundled
codex features list
codex review --uncommitted
codex exec --sandbox workspace-write --json "Explain this repository"The last two examples invoke a model. Distinguish shell commands such as codex review and codex resume from in-session /review and /resume.