ChatGPT web has its own composer command menu. Type / to see the actions
available in the current chat. It doesn’t expose the ChatGPT desktop app or CLI
command set; the Codex slash commands, CLI commands, and flags in this
reference don’t apply to ChatGPT web.
ChatGPT desktop app commands
The general Commands page covers app navigation, chat shortcuts, keyboard customization, and deep links for chats, settings, skills, scheduled tasks, plugins, and pets.
The Slash commands page covers the commands
available from the app composer, including /feedback, /goal, /init,
/mcp, /plan, /review, and /status.
How to read this reference
This page catalogs every documented Codex CLI command and flag. Use the interactive tables to search by key or description. Each section shows the option’s maturity and flags deprecated options and risky combinations.
The CLI inherits most defaults from ~/.codex/config.toml. Any
-c key=value overrides you pass at the command line take
precedence for that invocation. See Config
basics for more
information.
Global flags
| Key | Type / Values | Details |
|---|---|---|
--add-dir | path | Grant additional directories write access alongside the main workspace. Repeat for multiple paths. |
--approve-for-me, --not-so-yolo | boolean | Use automatic approval review with on-request approvals and the workspace-write sandbox. Conflicts with --sandbox and --yolo; the interactive CLI also rejects --ask-for-approval. |
--ask-for-approval, -a | on-request | never | Control when Codex pauses for human approval before running a command. |
--cd, -C | path | Set the working directory for the agent before it starts processing your request. |
--config, -c | key=value | Override configuration values. Values parse as TOML if possible; otherwise the literal string is used. |
--dangerously-bypass-approvals-and-sandbox, --yolo | boolean | Run every command without approvals or sandboxing. Only use inside an externally hardened environment. |
--dangerously-bypass-hook-trust | boolean | Run enabled hooks without requiring persisted hook trust for this invocation. Intended only for automation that already vets hook sources. |
--disable | feature | Force-disable a feature flag (translates to -c features.<name>=false). Repeatable. |
--enable | feature | Force-enable a feature flag (translates to -c features.<name>=true). Repeatable. |
--image, -i | path[,path...] | Attach one or more image files to the initial prompt. Separate multiple paths with commas or repeat the flag. |
--local-provider | lmstudio | ollama | Choose the local provider used with --oss, overriding oss_provider for this run. |
--model, -m | string | Override the model set in configuration (for example gpt-6.1-sol). |
--no-alt-screen | boolean | Disable alternate screen mode for the TUI (overrides tui.alternate_screen for this run). |
--no-daemon | boolean | Run the interactive CLI without the shared background server. Can't be combined with --remote or codex agents. |
--oss | boolean | Use a local open source model provider. Codex uses --local-provider, your configured oss_provider, or prompts you to choose between LM Studio and Ollama. |
--profile, -p | string | Layer $CODEX_HOME/profile-name.config.toml on top of the base user config. |
--remote | ws://host:port | wss://host:port | unix:// | unix://PATH | Connect to a remote app-server endpoint over WebSocket or a Unix socket. Supported for codex, codex agents, codex queue, codex resume, codex fork, codex archive, codex delete, and codex unarchive; other subcommands reject remote mode. |
--remote-auth-token-env | ENV_VAR | Read a bearer token from this environment variable and send it when connecting with --remote. Requires --remote; tokens are only sent over wss:// URLs or local-only ws:// URLs. |
--sandbox, -s | read-only | workspace-write | danger-full-access | Select the sandbox policy for model-generated shell commands. |
--search | boolean | Enable live web search (sets web_search = "live" instead of the default "cached"). |
--strict-config | boolean | Error when config.toml contains fields this Codex version does not recognize. Supported by runtime commands such as codex, exec, review, resume, fork, app-server, and exec-server. |
--worktree | boolean | Start in a new managed Git worktree. Supports new interactive sessions, codex fork <SESSION_ID>, codex exec, and codex exec fork; requires local execution. |
PROMPT | string | Optional text instruction to start the session. Omit to launch the TUI without a pre-filled message. |
--add-dirpath--approve-for-me, --not-so-yolobooleanon-request approvals and the workspace-write sandbox. Conflicts with --sandbox and --yolo; the interactive CLI also rejects --ask-for-approval.--ask-for-approval, -aon-request | never--cd, -Cpath--config, -ckey=value--dangerously-bypass-approvals-and-sandbox, --yoloboolean--dangerously-bypass-hook-trustboolean--disablefeature-c features.<name>=false). Repeatable.--enablefeature-c features.<name>=true). Repeatable.--image, -ipath[,path...]--local-providerlmstudio | ollama--oss, overriding oss_provider for this run.--model, -mstringgpt-6.1-sol).--no-alt-screenbooleantui.alternate_screen for this run).--no-daemonboolean--remote or codex agents.--ossboolean--local-provider, your configured oss_provider, or prompts you to choose between LM Studio and Ollama.--profile, -pstring$CODEX_HOME/profile-name.config.toml on top of the base user config.--remotews://host:port | wss://host:port | unix:// | unix://PATHcodex, codex agents, codex queue, codex resume, codex fork, codex archive, codex delete, and codex unarchive; other subcommands reject remote mode.--remote-auth-token-envENV_VAR--remote. Requires --remote; tokens are only sent over wss:// URLs or local-only ws:// URLs.--sandbox, -sread-only | workspace-write | danger-full-access--searchbooleanweb_search = "live" instead of the default "cached").--strict-configbooleanconfig.toml contains fields this Codex version does not recognize. Supported by runtime commands such as codex, exec, review, resume, fork, app-server, and exec-server.--worktreebooleancodex fork <SESSION_ID>, codex exec, and codex exec fork; requires local execution.PROMPTstringThese options apply to the base codex command. Most propagate to commands;
see the notes above or the relevant command help for exceptions. For propagated
flags, follow the relevant command help. For example, codex exec --oss ...
applies --oss to exec.
Command overview
The Maturity column uses feature maturity labels such as Experimental, Beta, Stable, and Deprecated. See Feature Maturity for how to interpret these labels.
| Key | Maturity | Details |
|---|---|---|
codex | Stable | Launch the terminal UI. Accepts the global flags above plus an optional prompt or image attachments. |
codex agents | Stable | Open the agent command center on a shared local or remote server. |
codex app | Stable | Launch the ChatGPT desktop app on macOS or Windows. On macOS, Codex can open a workspace path; on Windows, Codex prints the path to open. |
codex app-server | Experimental | Launch the Codex app server for local development or debugging over stdio, WebSocket, or a Unix socket. |
codex apply | Stable | Apply the latest diff generated by a Codex cloud chat to your local working tree. Alias: codex a. |
codex archive | Stable | Archive a saved interactive session by session ID or session name. |
codex cloud | Experimental | Browse or execute Codex cloud chats from the terminal without opening the TUI. Alias: codex cloud-tasks. |
codex completion | Stable | Generate shell completion scripts for Bash, Zsh, Fish, or PowerShell. |
codex debug app-server send-message-v2 | Experimental | Debug app-server by sending a single V2 message through the built-in test client. |
codex debug models | Experimental | Print the raw model catalog Codex sees, including an option to inspect only the bundled catalog. |
codex debug prompt-input | Experimental | Render the model-visible prompt input list as JSON, optionally with a prompt and images. |
codex delete | Stable | Permanently delete a saved interactive session by session ID or session name. |
codex doctor | Stable | Generate a diagnostic report for local installation, config, auth, runtime, Git, terminal, app-server, and thread inventory issues. |