Skip to main content
reopt Handbook
reopt Handbook
Codex Command MasterLabels and command selectionHow to read a detail guideComplete command listTerminal CLI Commands and Options

Task guides

Core Command GroupSession Command GroupCustom Command GuideMCP Command and Integration GuideDesign Workflows

Conversation and context

Cmd. /archiveCmd. /copyCmd. /importCmd. /cd

Planning and execution

Cmd. /goalCmd. /app

Models and settings

Cmd. /model

Permissions and integrations

Cmd. /pluginsCmd. /hooksCmd. /mcp

Display and input

Cmd. /statuslineCmd. /tuiCmd. /worktreeCmd. /voice

Account and usage

Cmd. /usage

Verification and history

Current verification scopeHandbook updatesRelease coverage historyEarlier verification recordsCommand change history
Handbook›Codex Command Master›Terminal CLI Commands and Options
한국어KOEnglishEN

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-program through 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

CommandUse
codexInteractive TUI
codex agentsStable · command center on a local or remote server
codex appLaunch the desktop app
codex app-serverIntegration server; experimental
codex applyApply a cloud diff
codex archiveArchive a saved session
codex cloudInspect/run cloud tasks; experimental
codex completionGenerate shell completions
codex debug app-server send-message-v2Diagnose a V2 protocol request
codex debug modelsModel catalog JSON
codex debug prompt-inputModel-visible prompt JSON
codex deletePermanently delete a session
codex doctorInstallation/config/runtime diagnostics
codex execNon-interactive task
codex execpolicyEvaluate execution rules; preview
codex featuresInspect/persist feature flags
codex forkFork a saved session
codex loginAccount/API authentication
codex logoutClear saved authentication
codex mcpManage external MCP servers
codex pluginManage plugins
codex plugin marketplaceManage marketplace sources
codex queueStable · queue a message by UUID or exact session name
codex remote-controlRemote daemon/pairing; experimental
codex resumeResume a conversation
codex reviewNon-interactive code review
codex sandboxExecute within an OS sandbox
codex unarchiveRestore an archived session
codex updateSelf-update supported release builds

Global options

KeyType, value, or arguments
--add-dirpath
--approve-for-me, --not-so-yoloboolean
--ask-for-approval, -aon-request | never
--cd, -Cpath
--config, -ckey=value
--dangerously-bypass-approvals-and-sandbox, --yoloboolean
--dangerously-bypass-hook-trustboolean
--disablefeature
--enablefeature
--image, -ipath[,path...]
--local-providerlmstudio | ollama
--model, -mstring
--no-alt-screenboolean
--no-daemonboolean
--ossboolean
--profile, -pstring
--remotews://host:port | wss://host:port | unix:// | unix://PATH
--remote-auth-token-envENV_VAR
--sandbox, -sread-only | workspace-write | danger-full-access
--searchboolean
--strict-configboolean
--worktreeboolean
PROMPTstring

--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

KeyType, value, or arguments
--analytics-default-enabledboolean
--code-mode-hostws://HOST/PATH | wss://HOST/PATH
--listenstdio:// | ws://IP:PORT | unix:// | unix://PATH | off
--stdioboolean
--ws-audiencestring
--ws-authcapability-token | signed-bearer-token
--ws-issuerstring
--ws-max-clock-skew-secondsnumber
--ws-shared-secret-fileabsolute path
--ws-token-fileabsolute path
--ws-token-sha256hexadecimal 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

KeyType, value, or arguments
--download-urlurl
PATHpath

codex debug app-server send-message-v2

KeyType, value, or arguments
USER_MESSAGEstring

codex debug models

KeyType, value, or arguments
--bundledboolean

--bundled inspects the binary’s catalog without a remote refresh.

codex debug prompt-input

KeyType, value, or arguments
--image, -ipath[,path...]
PROMPTstring

Inspect the output before sharing: it contains model-visible instructions and context.

codex apply

KeyType, value, or arguments
TASK_IDstring

codex review

KeyType, value, or arguments
--basebranch
--commitSHA
--strict-configboolean
--titlestring
--uncommittedboolean
PROMPTstring | - (read stdin)

Choose exactly one of --uncommitted, --base, --commit, or a custom PROMPT. Use --title with --commit.

codex archive and codex unarchive

KeyType, value, or arguments
--remotews://host:port | wss://host:port | unix:// | unix://PATH
--remote-auth-token-envENV_VAR
SESSIONsession ID | session name

codex delete

KeyType, value, or arguments
--forceboolean
--remotews://host:port | wss://host:port | unix:// | unix://PATH
--remote-auth-token-envENV_VAR
SESSIONsession ID | session name

--force applies only to session UUIDs. Named deletion still requires confirmation.

codex cloud

KeyType, value, or arguments
--attempts1-4
--envENV_ID
QUERYstring

This table describes task submission with codex cloud exec.

codex cloud list

KeyType, value, or arguments
--cursorstring
--envENV_ID
--jsonboolean
--limit1-20

codex completion

KeyType, value, or arguments
SHELLbash | zsh | fish | power-shell | elvish

codex doctor

KeyType, value, or arguments
--allboolean
--asciiboolean
--jsonboolean
--no-colorboolean
--summaryboolean

codex features

KeyType, value, or arguments
Disable subcommandcodex features disable <feature>
Enable subcommandcodex features enable <feature>
List subcommandcodex features list

Enable/disable persist in configuration. This command does not accept --profile.

codex exec

KeyType, value, or arguments
--approve-for-me, --not-so-yoloboolean
--cd, -Cpath
--coloralways | never | auto
--dangerously-bypass-approvals-and-sandbox, --yoloboolean
--dangerously-bypass-hook-trustboolean
--ephemeralboolean
--ignore-rulesboolean
--ignore-user-configboolean
--image, -ipath[,path...]
--json, --experimental-jsonboolean
--local-providerlmstudio | ollama
--model, -mstring
--ossboolean
--output-last-message, -opath
--output-schemapath
--profile, -pstring
--sandbox, -sread-only | workspace-write | danger-full-access
--skip-git-repo-checkboolean
--worktreeboolean
-c, --configkey=value
PROMPTstring | - (read stdin)
Resume subcommandcodex 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

KeyType, value, or arguments
--allboolean
--image, -ipath[,path...]
--lastboolean
PROMPTstring | - (read stdin)
SESSION_IDuuid | session name

--last scopes selection to the current directory; --all searches across directories.

codex execpolicy

KeyType, value, or arguments
--prettyboolean
--rules, -rpath (repeatable)
COMMAND...var-args

codex login

KeyType, value, or arguments
--device-authboolean
--with-access-tokenboolean
--with-api-keyboolean
status subcommandcodex login status

Supply API keys and access tokens via stdin, not argument values. status exits 0 when logged in.

codex mcp

KeyType, 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

KeyType, value, or arguments
--bearer-token-env-varENV_VAR
--env KEY=VALUErepeatable
--oauth-client-idCLIENT_ID
--oauth-resourceRESOURCE
--urlhttps://…
COMMAND...stdio transport

Do not combine --url with stdio COMMAND.... OAuth client/resource options require --url.

codex plugin

KeyType, 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

KeyType, 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

KeyType, value, or arguments
--allboolean
--include-non-interactiveboolean
--lastboolean
SESSION_IDuuid | session name

Persist the directory choice with tui.resume_cwd; explicit --cd takes precedence.

codex fork

KeyType, value, or arguments
--allboolean
--lastboolean
SESSION_IDuuid

macOS seatbelt

KeyType, value, or arguments
--allow-unix-socketpath
--cd, -CDIR
--config, -ckey=value
--include-managed-configboolean
--log-denialsboolean
--permission-profile, -PNAME
--profile, -pNAME
COMMAND...var-args

--cd and --include-managed-config require --permission-profile. --allow-unix-socket is macOS-specific.

Linux sandbox

KeyType, value, or arguments
--cd, -CDIR
--config, -ckey=value
--include-managed-configboolean
--permission-profile, -PNAME
--profile, -pNAME
COMMAND...var-args

--cd and --include-managed-config require --permission-profile.

Windows

KeyType, value, or arguments
--cd, -CDIR
--config, -ckey=value
--include-managed-configboolean
--permission-profile, -PNAME
--profile, -pNAME
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

CommandScope
codex exec --cyber-access-program0.161.0 per-turn Cyber access program selection; works with cli_daybreak disabled
codex --enable cli_daybreak0.161.0 opt-in for Daybreak controls and automatic Cyber routing
codex mcp add --oauth-client-secret0.158.0 client secret for a pre-registered OAuth client; use with --oauth-client-id
codex --no-daemon0.156.0 launch without the shared background server
codex app-server daemon update0.155.0 daemon update
codex agents / codex queue0.149–150 agent/queue operations
codex exec fork0.147–148 non-interactive fork
codex remote-control / codex remote-control start / codex remote-control stop / codex remote-control pairRemote foreground/daemon/pairing; supports --json
codex mcp-serverRemoved; 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.

Sources

  • Developer Commands
  • Changelog

Related docs

Advanced Codex Usage

An advanced operations and extension guide for teams standardizing Codex usage.

Updates

Advanced Codex Usage · Change log for the Advanced Codex Usage handbook.

Cmd. /import

Import Claude Code or Cursor setup, project files, and recent chats into Codex.

Handbook updates

Codex CLI: Recent handbook structure improvements with links to dated release coverage and audit records.

Verification Report

Agentic Documentation · Source, link, consistency, and build verification for the Agentic Documentation handbook.

Complete command list

Every Codex CLI slash command on one page: syntax, kind, and availability for all 57 official rows, plus examples, effects, and cautions by category.

Core Command Group

The most frequently used Codex commands, including full conversation export, in one page.

On this page

29 terminal commandsGlobal optionscodex app-servercodex appcodex debug app-server send-message-v2codex debug modelscodex debug prompt-inputcodex applycodex reviewcodex archive and codex unarchivecodex deletecodex cloudcodex cloud listcodex completioncodex doctorcodex featurescodex execcodex exec resumecodex execpolicycodex logincodex mcpcodex mcp addcodex plugincodex plugin marketplacecodex resumecodex forkmacOS seatbeltLinux sandboxWindowsCurrent options and compatibility in 0.163.0Release additions and compatibilitySources