Skip to main content

Reference · Reference

Codex CLI Commands List

Free OpenAI Codex CLI reference (2026): 73 entries covering core commands, key options, setup, and practical workflow examples. Search by category and copy snippets.

Last updated:

How to Use

Expand how to use
  1. 1

    Filter by category

    Switch between Core Commands, Key Options, Setup, and Workflow Examples to focus on the commands you need.

  2. 2

    Search details

    Use keyword search to match command names, option notes, and example commands at once.

  3. 3

    Copy and run

    Copy the command snippet with one click, then run it directly in your terminal.

Latest Updates (Summary)

Quick view of important changes. See details in the section below.

codex-cli 0.167.1 (November 10, 2026)

  • Internal patch release. It narrows which providers receive incremental tool definitions and adds the under-development feature flag incremental_tools_legacy (off by default)
  • Verification: the files changed between 0.167.0 and 0.167.1 were compared and the CLI argument definitions are untouched. No subcommands or global options were added or removed, so the count stays at 73

codex-cli 0.167.0 (November 6, 2026)

  • Open the agent command center with codex agents --no-daemon. The command center and session picker now mark unread results
  • Switch between connected backends from the terminal session picker while keeping your drafts. On supported terminals, preview local image attachments in the composer and open viewed images from clickable transcript paths
  • API key and cloud provider options are grouped under "Sign in another way". Enable gcp_setup_wizard to set up Google Cloud Vertex AI with Application Default Credentials or a credential file. /experimental can also opt into macOS or Windows system proxy settings
View detailed version updates

codex

Start an interactive Codex CLI session.

Key points

  • codex "<prompt>": Start with an initial prompt.
  • codex --help: Show available subcommands and global options.

Examples

codex
Launch interactive mode in the current directory.
codex "Summarize this repository structure"
Start a session with a task-focused prompt.

codex exec

Run Codex non-interactively for automation and CI-style tasks.

Key points

  • --sandbox: Choose execution sandbox mode.
  • --profile: Layer $CODEX_HOME/<name>.config.toml on top of the base user config.

Examples

codex exec "Review this PR diff"
Run a one-shot review task from the CLI.
cat plan.md | codex exec -
Read instructions from stdin.

codex review

Run a code review directly from the command line.

Key points

  • --uncommitted: Review staged, unstaged, and untracked changes.
  • --base <branch>: Compare the current branch against a base branch.
  • --commit <sha>: Review changes introduced by a specific commit.

Examples

codex review --uncommitted
Review local changes before committing.
codex review --base main
Review changes against main branch.

codex resume

Resume a previous interactive session.

Key points

  • --last: Resume the most recent session immediately.
  • --all: Show all sessions beyond current working directory filter.

Examples

codex resume --last
Continue the latest session quickly.
codex resume <SESSION_ID>
Resume a specific saved session.

codex fork

Fork a previous interactive session into a new conversation branch.

Key points

  • --last: Fork the most recent session without opening the picker.
  • --all: Show sessions across all working directories in the picker.

Examples

codex fork --last
Fork the latest session and continue in a new direction.
codex fork <SESSION_ID> "Try an alternative implementation"
Start a new branch from a specific session.

codex archive

Archive a saved session by id or session name (added in v0.136.0). Archived sessions are excluded from resume / fork until restored.

Key points

  • codex archive <SESSION>: Archive a session by its id (UUID) or session name.
  • The /archive slash command in the TUI performs the same operation.

Examples

codex archive <SESSION>
Archive a finished session to keep your session list tidy.
codex unarchive <SESSION>
Restore the session later when you need it again.

codex unarchive

Restore an archived session so it can be resumed or forked again (added in v0.136.0).

Key points

  • codex unarchive <SESSION>: Restore a session by its id (UUID) or session name.
  • Restored sessions reappear in the codex resume picker.

Examples

codex unarchive <SESSION>
Restore an archived session.
codex resume <SESSION_ID>
Resume the restored session and continue working.

codex delete

Permanently delete a saved session by its id or session name (added in v0.140.0). Unlike archiving, deletion cannot be undone, so a confirmation prompt is shown beforehand and related subagents are cleaned up.

Key points

  • codex delete <SESSION>: Delete a session by its id (UUID) or session name. UUIDs take precedence when parseable.
  • --force: Delete without prompting (SESSION must be a UUID).
  • The /delete slash command in the TUI performs the same operation.

Examples

codex delete <SESSION>
Permanently delete a session you no longer need, after confirmation.
codex delete --force <SESSION_ID>
Delete a session immediately without prompting (UUID required).

codex migrate-rollouts

Inspect or migrate legacy local sessions into paginated thread history (added in v0.148.0). By default it only reports the sessions that are eligible for migration; the migration itself runs when you pass --apply.

Key points

  • --apply: Actually perform the migration (without it, only eligible sessions are reported).
  • --thread <THREAD_ID>: Limit the run to a specific thread.
  • --max-mib-per-second <MIB>: Throttle read/write throughput.
  • --json: Emit the result as JSON.
  • --verbose: Print detailed logs.

Examples

codex migrate-rollouts
Report which sessions are eligible, without migrating anything.
codex migrate-rollouts --apply
Migrate legacy sessions into paginated thread history.

codex apply

Apply the latest diff generated by Codex to your local working tree via git apply.

Key points

  • <TASK_ID>: Specify the Codex task ID to apply.
  • Review the generated diff in Codex Cloud before applying locally.

Examples

codex apply <TASK_ID>
Apply the latest diff for the specified task.
codex cloud diff <TASK_ID>
Preview the patch before applying it locally.

codex cloud

Manage Codex Cloud tasks and apply results locally from the CLI.

Key points

  • codex cloud list: List tasks in Codex Cloud.
  • codex cloud apply <TASK_ID>: Apply a cloud task diff to local repository.

Examples

codex cloud list
Check available tasks from Codex Cloud.
codex cloud diff <TASK_ID>
Preview task diff before applying locally.

codex app

Launch the Codex desktop app (downloads installer if it is missing).

Key points

  • codex app: Open Codex desktop app on macOS.
  • Useful when switching between terminal workflows and desktop session management.

Examples

codex app
Launch (or install then launch) the desktop app.
codex app --help
Check platform support and startup options.

codex login

Manage Codex CLI authentication. Provides subcommands for login and token management.

Key points

  • codex login: Start browser-based authentication flow.
  • codex login status: Check current login state.

Examples

codex login
Authenticate via browser.
codex login status
Check authentication state and user info.

codex logout

Remove stored credentials and sign out from Codex CLI.

Key points

  • codex logout: Deletes locally stored authentication tokens.
  • Useful for shared machines and CI cleanup workflows.

Examples

codex logout
Clear the current authenticated session.
codex login
Sign in again when needed.

codex app-server

Run experimental app-server tooling from Codex CLI.

Key points

  • codex app-server: Starts the app server or related tooling (experimental).
  • codex app-server daemon <bootstrap|start|restart|update|stop|version|enable-remote-control|disable-remote-control>: Manage the local app-server daemon. update (update the daemon package; may interrupt running work) was added in 0.155.0.
  • codex app-server --help: Show available subcommands and flags.

Examples

codex app-server --help
Inspect supported app-server operations.
codex app-server
Start the experimental app-server command.

codex exec-server

Run the standalone exec-server binary (experimental, added in v0.119.0). Exposes a WebSocket endpoint for remote or app-server workflows.

Key points

  • --listen <URL>: Transport endpoint URL (default ws://127.0.0.1:0).
  • -c, --config <key=value>: Override a value from config.toml for this run.
  • --enable / --disable <FEATURE>: Toggle feature flags for the session.
  • --remote-transport <noise|direct>: Transport used for the remote executor connection (default noise, added in v0.154.0).
  • --ws-auth <capability-token|signed-bearer-token>: Authentication mode for incoming WebSocket connections (added in v0.158.0). Pair it with --ws-token-file <PATH> / --ws-token-sha256 <HEX> for capability tokens, or --ws-shared-secret-file <PATH> / --ws-issuer <ISSUER> / --ws-audience <AUDIENCE> / --ws-max-clock-skew-seconds <SECONDS> for signed JWT bearer tokens.
  • --linux-sandbox-pid-namespace <isolate|inherit>: Linux PID namespace mode (default isolate). inherit allows signals to other same-UID processes, so use it only in a dedicated environment (added in v0.158.0).
  • --proxy-private-ips-via-upstream: Let permitted private IP destinations go through the configured upstream proxy; if no upstream proxy applies to the protocol, connect directly. Loopback stays local. Also settable via the CODEX_EXEC_SERVER_PROXY_PRIVATE_IPS_VIA_UPSTREAM environment variable (added in v0.159.0).
  • --aws-sigv4 / --aws-profile <PROFILE> / --aws-region <REGION> / --aws-service <SERVICE>: Sign Direct registration and WebSocket handshake requests with AWS SigV4 (added in v0.154.0; --aws-service defaults to execute-api, and the SDK region chain is used when --aws-region is omitted).

Examples

codex exec-server
Start on the default local WebSocket endpoint.
codex exec-server --listen ws://127.0.0.1:8080
Listen on a specific port.

codex remote-control

Start a headless app-server with remote control enabled (experimental, added in v0.130.0). Acts as a simpler entry point than codex app-server for spinning up a remotely controllable server.

Key points

  • codex remote-control: Launch the app-server with remote control enabled.
  • -c, --config <key=value>: Override a config.toml value for this launch.
  • --enable / --disable <FEATURE>: Toggle feature flags at startup.

Examples

codex remote-control
Start a headless app-server you can drive remotely.
codex remote-control --help
Inspect available options and flags.

codex remote-control pair

Create and print a short-lived manual pairing code from a running codex remote-control daemon (experimental, added in v0.143.0). Use it to manually pair a remote client with the daemon.

Key points

  • codex remote-control pair: Generate a short-lived manual pairing code.
  • --json: Emit the pairing code as machine-readable JSON.
  • -c, --config <key=value>: Override a config value for this run.

Examples

codex remote-control pair
Print a short-lived code for manual pairing.
codex remote-control pair --json
Get the pairing code as JSON.

codex sandbox

Run commands within a Codex-provided sandbox environment.

Key points

  • codex sandbox: Entry point for sandbox utility commands.
  • codex sandbox uninstall: Remove the legacy Windows sandbox's machine-wide accounts and network rules (added in v0.162.0).
  • codex sandbox --help: Show sandbox subcommands and usage.

Examples

codex sandbox --help
Review available sandbox capabilities.
codex sandbox
Execute sandbox-related commands directly.

codex debug

Use built-in debugging tools for troubleshooting Codex CLI.

Key points

  • codex debug: Entry point for debugging utilities.
  • codex debug --help: List diagnostics and debug helpers.

Examples

codex debug --help
List debug subcommands before running them.
codex debug
Run debug tooling from the CLI.

codex update

Update the Codex CLI to the latest version (added in v0.128.0).

Key points

  • codex update: Pulls the latest release and replaces the local binary.
  • Run codex --version afterwards to confirm the upgrade.

Examples

codex update
Upgrade to the latest Codex CLI release.
codex update && codex --version
Update and verify the new version.

codex doctor

Diagnose the health of your local Codex installation, config, auth, and runtime (added in v0.131.0).

Key points

  • --summary: Show only grouped check rows and the final count summary.
  • --json: Emit a redacted, machine-readable report.
  • --all: Expand long lists in detailed human output.
  • --network-only: Run only the config, network environment, provider HTTP, and Responses WebSocket checks (added in v0.166.0).

Examples

codex doctor
Diagnose installation and configuration at once.
codex doctor --json
Get a machine-readable diagnostic report for CI.

codex login status

Check the current authentication status.

Key points

  • Shows user info when authenticated.
  • Suggests codex login when not authenticated.

Examples

codex login status
Check login state.
codex login status && codex exec "task"
Verify auth before running a task.

codex plugin

Manage Codex plugins (added in 0.122.0). Umbrella subcommand for plugin and marketplace management.

Key points

  • codex plugin marketplace: Manage plugin marketplaces (add, upgrade, remove).
  • Combines with feature flags and -c/--config overrides like other subcommands.

Examples

codex plugin --help
List available plugin subcommands.
codex plugin marketplace add openai/codex-marketplace
Install the official marketplace via the new plugin surface.

codex plugin marketplace

Manage plugin marketplaces for Codex (moved from codex marketplace to codex plugin marketplace in 0.122.0).

Key points

  • add <SOURCE>: Install a plugin marketplace from GitHub (owner/repo[@ref]), an HTTP(S)/SSH Git URL, or a local directory.
  • list: List the plugin marketplaces Codex is currently considering and their roots (confirmed in the 0.155.0 --help).
  • upgrade: Update installed marketplaces.
  • remove: Uninstall a marketplace.

Examples

codex plugin marketplace add openai/codex-marketplace
Install the official marketplace from GitHub.
codex plugin marketplace add ./local-marketplace
Install from a local marketplace directory.

codex agents

Open the agent command center, an interactive dashboard to browse and switch agent sessions (added in v0.149.0; described as the command center since v0.167.0). Search, start, open, rename, and stop tasks with configurable shortcuts.

Key points

  • --no-daemon: Run the agents overview with an embedded app server instead of the shared daemon (available since v0.167.0).
  • --remote <ADDR>: Connect to a remote app server endpoint (ws://, wss://, or unix://).
  • -C, --cd <DIR>: Directory to use for new tasks on a remote server.
  • --no-alt-screen: Disable alternate screen mode.

Examples

codex agents
Open the dashboard listing local agent sessions.
codex agents --remote ws://localhost:8080
List sessions on a remote app server.

codex queue

Queue a message for an existing session (added in v0.149.0). Send the next instruction to a local or remote session without reopening an interactive session.

Key points

  • --thread <THREAD>: Session UUID or exact session name (required).
  • --message <TEXT>: Message text to queue (required).
  • --remote <ADDR>: Connect to a remote app server endpoint.
  • --resume: After queueing, try to resume the thread on the local daemon or the --remote server (added in v0.166.0; a failed resume only warns and the command still succeeds).

Examples

codex queue --thread my-session --message "Run the tests and summarize the result"
Queue the next instruction for a session identified by name.
codex queue --thread 0199f0c2-... --message "Fix the lint errors"
Send a message to a session identified by UUID.

codex migrate-nfs-db

[experimental] Migrate configured SQLite databases to DELETE mode (a journal mode without WAL) in place (added in v0.164.0). Intended for databases stored on NFS: stop SQLite clients on every host before running it and keep them stopped through cutover. The NFS mount must support cross-client POSIX locks (no nolock or local_lock=all).

Key points

  • --staging-dir <STAGING_DIR>: A local directory with space for the database and WAL files (default: the system temporary directory).
  • -c, --config <key=value>: Override a value from config.toml.
  • --enable / --disable <FEATURE>: Turn a feature flag on or off (repeatable).

Examples

codex migrate-nfs-db --staging-dir /tmp/codex-migrate
Run the migration with a chosen staging directory.

-m, --model

Specify the model the agent should use.

Key points

  • -m <model>: Launch with a specific model.
  • Temporarily overrides the default from config.toml.

Examples

codex -m o3 "Analyze this code"
Start an interactive session with o3.
codex exec -m codex-mini-latest "Check the structure"
Run non-interactively with a lightweight model.

-p, --profile

Layer a named profile file from $CODEX_HOME (name.config.toml) on top of the base user config.

Key points

  • fast, default, deep, and max are examples of user-defined names, not built-in profiles.
  • Before using --profile fast, create $CODEX_HOME/fast.config.toml. Its settings determine the model and reasoning depth.

Examples

codex exec --profile fast "Inspect routing"
Analyze using the settings in your existing fast.config.toml.
codex exec --profile deep "Design refactor plan"
Plan using the settings in your existing deep.config.toml.

-s, --sandbox

Control filesystem permissions for model-executed commands.

Key points

  • read-only: Prevent file writes.
  • workspace-write | danger-full-access: Allow broader editing access.

Examples

codex exec --sandbox read-only "List potential bugs"
Analyze code without changing files.
codex exec --sandbox workspace-write "Apply the fix"
Allow edits in the current workspace.

-a, --ask-for-approval

Set when Codex asks for approval before running commands.

Key points

  • on-request: The model decides when to ask you for approval.
  • never: Never ask for approval; execution failures are returned straight to the model.
  • on-failure: Deprecated in the latest CLI.
  • untrusted: Removed in v0.149.0 (through 0.148.0 it asked for approval for commands outside the trusted set).

Examples

codex -a on-request
Start interactive mode with request-based approvals.
codex exec -a never "Run checks and summarize"
Use no-approval policy for scripted runs.

--search

Enable live web search in supported sessions.

Key points

  • codex --search: Enable web search for a new interactive session.
  • When enabled, the Responses web_search tool is available.
  • codex resume --search: Resume a session with web search enabled.

Examples

codex --search "Check latest framework changes"
Start with web search enabled.
codex resume --last --search
Continue the latest session with web search.

--remote

Connect the TUI to a remote app-server endpoint.

Key points

  • --remote <ws://...|wss://...>: Connect to an app-server-backed WebSocket endpoint.
  • Useful when Codex app-server runs on another machine or as a long-lived service.

Examples

codex --remote ws://127.0.0.1:8080
Launch the TUI against a local app-server WebSocket.
codex --remote wss://codex.example.com/socket --no-alt-screen
Use a remote endpoint while keeping inline terminal scrollback.

-i, --image

Attach image files to the initial prompt.

Key points

  • -i <file>: Specify image file(s) (repeatable).
  • Useful for analyzing screenshots and UI designs.

Examples

codex -i screenshot.png "Suggest improvements for this UI"
Start a session with an attached image.
codex exec -i error.png "Identify the cause of this error"
Run non-interactively with an image.

-C, --cd

Set the working root directory for the agent.

Key points

  • -C <dir>: Use the specified directory as the workspace root.
  • Useful for running Codex against a different project.

Examples

codex -C /path/to/project
Start a session in a different directory.
codex exec -C ../other-repo "Run the tests"
Run non-interactively in another repository.

--add-dir

Add extra writable directories alongside the primary workspace.

Key points

  • --add-dir <dir>: Grant write access to an additional directory.
  • Useful for monorepos and shared library access.

Examples

codex --add-dir ../shared-lib
Allow edits to a shared library directory.
codex exec --add-dir ../configs "Update the settings"
Grant write access to a config directory.

codex --oss

Use a local open-source model provider.

Key points

  • --oss: Connect to LM Studio or Ollama.
  • --local-provider <provider>: Explicitly choose lmstudio or ollama.

Examples

codex --oss
Start a session with a local model.
codex --oss --local-provider ollama
Explicitly use Ollama as the provider.

--no-alt-screen

Disable alternate screen mode and run inline, preserving scrollback history.

Key points

  • Preserves terminal scrollback history.
  • Useful in terminal multiplexers like Zellij.

Examples

codex --no-alt-screen
Launch while preserving scrollback.
codex --no-alt-screen "Start working"
Interactive session in a multiplexer environment.

--skip-git-repo-check

Allow codex exec to run outside a Git repository.

Key points

  • --skip-git-repo-check: Skip Git repository validation.
  • For standalone scripts and document generation outside repos.

Examples

codex exec --skip-git-repo-check "Draft a README"
Run in a non-Git directory.
codex exec --skip-git-repo-check --sandbox read-only "Analyze"
Combine with read-only for safe execution.

--ephemeral

Run without persisting session files to disk.

Key points

  • --ephemeral: Disable session persistence.
  • Keeps disk clean for temporary analysis and CI runs.

Examples

codex exec --ephemeral "Explain this function"
Analyze without saving a session.
codex exec --ephemeral --sandbox read-only "Check dependencies"
Leave no trace with read-only analysis.

--output-schema

Validate the model's final response against a JSON Schema.

Key points

  • --output-schema <file>: Path to a JSON Schema file.
  • Ensures structured output in CI/CD pipelines.

Examples

codex exec --output-schema schema.json "Output analysis as JSON"
Get schema-validated structured output.
codex exec --output-schema report.schema.json -o result.json "Generate report"
Schema validation with file output.

--enable / --disable

Toggle feature flags from the command line.

Key points

  • --enable <feature>: Shortcut for -c features.<name>=true.
  • --disable <feature>: Shortcut for -c features.<name>=false.

Examples

codex --enable some_feature
Enable a specific feature for this session.
codex exec --disable experimental_feature "Run task"
Disable an experimental feature for this run.

--dangerously-bypass-approvals-and-sandbox

Skip all approval prompts and execute without sandboxing. For externally sandboxed environments only.

Key points

  • Skips all confirmation prompts and disables sandboxing.
  • Intended solely for Docker or externally isolated environments.

Examples

codex exec --dangerously-bypass-approvals-and-sandbox "Build"
Use only in externally sandboxed environments.
# Use inside Docker or isolated containers
Never use directly on development machines.

--local-provider

Specify which local model provider to use: lmstudio or ollama.

Key points

  • --local-provider <provider>: Choose lmstudio or ollama explicitly.
  • Used with --oss. If omitted, uses config default or shows a selection prompt.

Examples

codex --oss --local-provider lmstudio
Explicitly use LM Studio as the provider.
codex --oss --local-provider ollama "Analyze the code"
Use Ollama with an initial prompt.

--color

Configure color output for exec mode.

Key points

  • --color <always|never|auto>: Set color output mode.
  • Use never in CI to strip ANSI escapes. Defaults to auto.

Examples

codex exec --color never "Run the tests"
Plain output for log files.
codex exec --color always "Show the diff"
Force color output even when piped.

--remote-auth-token-env

Specify the environment variable containing a bearer token for remote app-server WebSocket connections.

Key points

  • --remote-auth-token-env <ENV_VAR>: Read the bearer token from the named environment variable and send it when connecting.
  • Use with --remote for authenticated remote connections.

Examples

codex --remote wss://codex.example.com/ws --remote-auth-token-env CODEX_TOKEN
Connect remotely using the token in the CODEX_TOKEN variable.
CODEX_TOKEN=secret codex resume --last --remote wss://host:8080 --remote-auth-token-env CODEX_TOKEN
Resume the latest session over an authenticated remote connection.

--json

Print exec events to stdout as JSON Lines.

Key points

  • --json: Stream events in JSONL format.
  • Ideal for programmatic parsing and CI/CD pipeline integration.

Examples

codex exec --json "Analyze the code" > events.jsonl
Save event log to a file.
codex exec --json "Run tests" | jq '.type'
Filter event types with jq.

-o, --output-last-message

Write the agent's final message to a specified file.

Key points

  • -o <file>: Set the output file for the last response.
  • Useful for CI/CD result capture and report generation.

Examples

codex exec -o result.txt "Summarize this PR"
Save the final response to a text file.
codex exec --output-schema schema.json -o result.json "Generate report"
Schema-validated JSON file output.

--ignore-user-config

Run codex exec without loading the user-level config.toml (added in 0.122.0). Auth credentials are still resolved from CODEX_HOME.

Key points

  • --ignore-user-config: Skip $CODEX_HOME/config.toml while keeping CLI-specified -c overrides.
  • Useful in CI runners to enforce deterministic, profile-free runs.

Examples

codex exec --ignore-user-config "Run tests and summarize failures"
Execute without interference from personal configuration.
codex exec --ignore-user-config -c model=o3 "Refactor utils"
Start from a clean slate and override the model inline.

--ignore-rules

Skip user/project execpolicy .rules files when running codex exec (added in 0.122.0).

Key points

  • --ignore-rules: Ignore both user and project .rules policy files for this run.
  • Combine with --ignore-user-config for fully isolated automated runs.

Examples

codex exec --ignore-rules "Check formatting"
Bypass locally defined execpolicy rules.
codex exec --ignore-rules --ignore-user-config --sandbox read-only "Audit dependencies"
Fully isolated audit from any user-side configuration.

--strict-config

Error out when config.toml contains fields not recognized by this version of Codex.

Key points

  • --strict-config: Fail when unknown configuration keys are detected.
  • Useful for catching config mistakes and typos early.

Examples

codex --strict-config
Fail at startup if unknown config keys exist.
codex exec --strict-config "Run the tests"
Strictly validate configuration in CI.

--dangerously-bypass-hook-trust

Run enabled hooks without requiring persisted hook trust for this invocation (added in v0.131.0). Dangerous; use only for automation that already vets hook sources.

Key points

  • --dangerously-bypass-hook-trust: Skip the hook trust check for this run only.
  • **Dangerous**: For automation environments where hook sources are already vetted.

Examples

codex exec --dangerously-bypass-hook-trust "Run with hooks"
Run hooks without the trust prompt (vetted environments only).
# Use in CI where hook sources are managed
Do not use during interactive development.

-P, --permission-profile

Apply a named permissions profile from the active configuration stack in codex sandbox (added in v0.139.0).

Key points

  • -P, --permission-profile <name>: Name of the permissions profile to apply.
  • Reuse a sandbox permission set defined in config.toml by name.

Examples

codex sandbox -P ci-readonly -- npm test
Run the command with the ci-readonly profile permissions.
codex sandbox --permission-profile build -- make
Build with the write access granted by the build profile.

--approve-for-me

Route approval requests through automatic review using the workspace-write sandbox (added in v0.147.0).

Key points

  • --approve-for-me: Hand pending approvals to automatic review and run them in the workspace-write sandbox.
  • Accepted by both the interactive session (codex) and non-interactive runs (codex exec).

Examples

codex --approve-for-me
Let automatic review handle approval prompts in an interactive session.
codex exec --approve-for-me "Fix the failing tests"
Keep a non-interactive run moving without stalling on approvals.

--thread-source

Classify the source of newly created or forked threads (added in v0.149.1).

Key points

  • --thread-source <SOURCE>: Set the source classification for the thread; defaults to user when omitted.
  • Accepts user, subagent, and memory_consolidation, plus any custom feature name.
  • A global option of codex exec. Resuming an existing thread does not overwrite its stored value.

Examples

cat task.md | codex exec --thread-source subagent -
Run the session classified as originating from a subagent.
cat spec.md | codex exec --thread-source ci-nightly -
Tag the thread with a custom feature name to filter by source later.

--worktree

Run the session in a new managed Git worktree (experimental, added in v0.154.0). Lets new or forked sessions work in an isolated checkout.

Key points

  • --worktree: Create a new managed Git worktree and run the session inside it.
  • Available at the top level and on exec / resume / fork / archive / unarchive / delete (queue dropped it in v0.166.0).
  • The in-session equivalent is /worktree.

Examples

codex --worktree
Start an interactive session in a newly created worktree.
codex exec --worktree "<prompt>"
Run non-interactively inside an isolated worktree.

--no-daemon

Run Codex without the shared background server (the local daemon), even if it is already running (added in v0.156.0).

Key points

  • --no-daemon: bypass the shared background server for this session only.
  • Available at the top level and on resume / fork / agents (agents since v0.167.0).
  • Update the daemon itself from inside a session with /daemon.

Examples

codex --no-daemon
Start an interactive session without the daemon.

--cyber-access-program

Request an experimental Cyber access program for this turn (`codex exec` only, OpenAI provider only; added in v0.161.0).

Key points

  • --cyber-access-program <PROGRAM>: one of standard / daybreak_blue / daybreak_red. Omit it to use the server defaults.
  • Leaves your saved choice unchanged and works even with the `cli_daybreak` feature disabled.
  • Not supported with review; fork requires a prompt.

Examples

codex exec --cyber-access-program standard "<prompt>"
Run non-interactively with the standard program.

-c, --config

Override config values from the command line.

Key points

  • -c model="gpt-5-codex": Set model for the current run.
  • -c features.name=true: Toggle a feature flag for this run only.

Examples

codex -c model="gpt-5-codex"
Launch with a specific model override.
codex exec -c 'sandbox_permissions=["workspace-write"]' "Explain risk"
Override sandbox permissions inline.

codex login --with-api-key

Authenticate Codex using API key, device auth flow, or access token.

Key points

  • --with-api-key: Read API key from stdin.
  • --device-auth: Use browser-based device authentication.
  • --with-access-token: Read access token from stdin.

Examples

printenv OPENAI_API_KEY | codex login --with-api-key
Login non-interactively with environment variable.
codex login --device-auth
Start interactive device authentication.
printenv CODEX_ACCESS_TOKEN | codex login --with-access-token
Login non-interactively with an access token.

codex mcp add

Manage external MCP servers in Codex.

Key points

  • codex mcp add <name> flags: --url <URL> (streamable HTTP server) or -- <COMMAND> (stdio server); --env <KEY=VALUE> (stdio only); --bearer-token-env-var <ENV_VAR> (HTTP only); --oauth-client-id <CLIENT_ID> / --oauth-client-secret <CLIENT_SECRET> for a pre-registered OAuth client.
  • codex mcp list: Show configured MCP servers.
  • codex mcp remove <name>: Remove an MCP server from config.
  • codex mcp login <name> / logout <name>: Interactively authenticate or deauthenticate an MCP server that requires OAuth (no experimental opt-in needed since v0.144.0). login --no-browser (added in v0.156.0) prints the authorization URL and accepts the callback URL without opening a browser.

Examples

codex mcp add docs -- command --flag
Register a new MCP server command.
codex mcp get docs
Inspect details of a configured MCP server.

codex features

Inspect and manage Codex feature flags from the CLI.

Key points

  • codex features list: Show known features and their effective state.
  • codex features enable|disable <name>: Persist toggles in config.toml.

Examples

codex features list
Check staged and experimental flags before enabling.
codex features enable <feature_name>
Enable a feature flag in your local Codex config.

codex completion zsh

Generate shell completion scripts.

Key points

  • codex completion zsh: Output zsh completion script.
  • codex completion bash: Output bash completion script.

Examples

codex completion zsh > ~/.zsh/completions/_codex
Install zsh completion manually.
codex completion fish > ~/.config/fish/completions/codex.fish
Install fish completion script.

codex plugin marketplace add <SOURCE>

Add a remote plugin marketplace repository via codex plugin marketplace add (moved under codex plugin in 0.122.0).

Key points

  • <SOURCE> accepts owner/repo[@ref], HTTP(S) or SSH Git URLs, or a local marketplace root directory.
  • --ref <REF>: Git ref to check out. Overrides any @ref or #ref suffix in SOURCE.
  • --sparse <PATH>: Sparse-checkout path (repeatable) for trimming large Git sources.

Examples

codex plugin marketplace add openai/codex-marketplace@main
Pin a GitHub marketplace to a specific branch or tag.
codex plugin marketplace add https://github.com/openai/codex-marketplace.git --sparse plugins/linter
Fetch only the plugins/linter subtree via sparse checkout.

codex exec --profile fast --sandbox read-only "<prompt>"

Safe analysis workflow for read-only inspection.

Key points

  • --profile fast: Apply your previously created $CODEX_HOME/fast.config.toml.
  • --sandbox read-only: Guarantee no file modifications.

Examples

codex exec --profile fast --sandbox read-only "Find dead code candidates"
Run static analysis without editing files.
codex exec --profile fast --sandbox read-only "Map i18n key usage"
Inspect translation usage safely.

codex exec --profile default --sandbox workspace-write "<prompt>"

Standard implementation workflow with editable workspace.

Key points

  • --profile default: Apply your previously created $CODEX_HOME/default.config.toml.
  • --sandbox workspace-write: Allow edits inside project workspace.

Examples

codex exec --profile default --sandbox workspace-write "Implement tooltip improvements"
Run a typical implementation task.
codex exec --profile default --sandbox workspace-write "Update docs and tests"
Apply code and documentation updates together.

codex review --uncommitted

Review local changes before commit.

Key points

  • --uncommitted: Include staged, unstaged, and untracked files.
  • --title <name>: Add context label to review summary.

Examples

codex review --uncommitted
Run a quick local review pass.
codex review --uncommitted --title "before-merge-check"
Attach a custom review title.

codex exec --json -o result.json "<prompt>"

Produce machine-readable output for automation pipelines.

Key points

  • --json: Stream execution events as JSONL.
  • -o <file>: Save the last assistant message to a file.

Examples

codex exec --json -o result.json "List migration risks"
Capture structured events and final summary.
codex exec --json "Generate release notes draft"
Use JSONL stream in custom tooling.

codex review --base <branch>

Review changes against a specified base branch.

Key points

  • --base <branch>: Set the base branch for comparison.
  • Ideal for pre-PR branch-to-branch reviews.

Examples

codex review --base main
Review diff against the main branch.
codex review --base develop "Review for security issues"
Branch review with custom instructions.

codex review --commit <sha>

Review the changes introduced by a specific commit.

Key points

  • --commit <sha>: Specify the commit SHA to review.
  • --title <title>: Add a title to the review summary.

Examples

codex review --commit abc1234
Review a specific commit's changes.
codex review --commit HEAD --title "Latest commit review"
Review the latest commit with a title.

codex cloud exec "<prompt>"

Submit a task to Codex Cloud for remote non-interactive execution.

Key points

  • codex cloud exec: Create a cloud task without launching the TUI.
  • Use codex cloud status / list / diff / apply to check and apply results.

Examples

codex cloud exec "Run all tests and report results"
Execute a task in the cloud.
codex cloud list && codex cloud apply <task-id>
List tasks and apply a diff locally.

codex exec fork <session-id> "<prompt>"

Fork a previous session by id into a new session and run it non-interactively (added in v0.148.0). Use it when you want to branch off an existing session from a script or CI pipeline while keeping the original intact.

Key points

  • codex exec fork <SESSION_ID> "<prompt>": Fork the given session and run non-interactively.
  • -i / --image: Attach images to the prompt used after forking.
  • Pass - as the prompt to read it from stdin.

Examples

codex exec fork <SESSION_ID> "<prompt>"
Branch off a previous session and run it non-interactively.
codex exec fork <SESSION_ID> -
Fork a session with the prompt piped in from stdin.

Codex CLI steps we ran and checked

This section is not copied from the official docs. We ran codex exec on our own machine and recorded what happened. Prompts were sent from an empty test folder, and the messages and exit codes are reported as they appeared.

Tested on: macOS 26.7 (Apple silicon) / codex-cli 0.167.0 / November 11, 2026

Everything below was run and checked on this environment. Output and defaults may differ on other operating systems or versions.

Run from a script and capture only the result

Steps

  1. Inside a Git repository, run codex exec "your prompt".
  2. Add -o result.txt to save the final answer to a file.
  3. Add --json if you want to process the progress events with a program.

What we observed

  • The final answer went to stdout. The header (workdir, model, sandbox, session id) and the progress log went to stderr. With 2>/dev/null, only the final answer remained.
  • The file given to -o contained the same final answer as stdout.
  • With --json, the output was one JSON object per line in this order: thread.started, turn.started, item.completed, turn.completed. The turn.completed event carried token usage (usage).
  • Text piped into stdin was appended to the prompt and reached the model.

If it does not work

  • Not inside a trusted directory and --skip-git-repo-check was not specified. with exit code 1 means the command ran outside a Git repository. Moving into a repository, or adding --skip-git-repo-check, let it run.
  • When started without a terminal, stderr began with Reading additional input from stdin.... It also appeared with < /dev/null, and the run continued normally. It is not an error.

Let Codex modify files

Steps

  1. Set the sandbox explicitly, for example codex exec -s workspace-write "your prompt".
  2. Check the sandbox: line in the stderr header to see which mode was applied.

What we observed

  • Plain codex exec started with approval: never and sandbox: read-only (no sandbox setting in ~/.codex/config.toml).
  • When asked to create a file in read-only mode, it answered that it could not, and no file was created. The exit code was still 0.
  • With -s workspace-write, the header showed sandbox: workspace-write [workdir, /tmp, $TMPDIR] and the file was created in the working folder.

If it does not work

  • If no file is written, check whether the sandbox: line in the header says read-only.
  • The exit code did not tell us whether the task was completed. In CI, check the result itself (the file or the diff) in addition to the exit code.

Continue the previous session

Steps

  1. In the same folder as before, run codex exec resume --last "follow-up prompt".
  2. To continue a specific session, take the ID from the session id: line in the header and run codex exec resume <SESSION_ID> "follow-up prompt".

What we observed

  • --last picked the most recent session that had been run in the current folder. A newer session run from a different folder was not picked.
  • The resumed session kept the same session id and remembered the earlier work.
  • A session started with -s workspace-write stayed at sandbox: workspace-write when resumed without -s.
  • Session records were stored at ~/.codex/sessions/YYYY/MM/DD/rollout-<timestamp>-<session id>.jsonl.

If it does not work

  • If a different session is resumed, check that you are in the same folder as last time. The help text lists an --all option that turns off the folder filter (we did not run it).

Important Updates by Version

Summarized from official OpenAI GitHub releases, focused on practical capabilities.

codex-cli 0.167.1 (November 10, 2026)

View official release

  • Internal patch release. It narrows which providers receive incremental tool definitions and adds the under-development feature flag incremental_tools_legacy (off by default)
  • Verification: the files changed between 0.167.0 and 0.167.1 were compared and the CLI argument definitions are untouched. No subcommands or global options were added or removed, so the count stays at 73
codex-cli 0.167.0 (November 6, 2026)

View official release

  • Open the agent command center with codex agents --no-daemon. The command center and session picker now mark unread results
  • Switch between connected backends from the terminal session picker while keeping your drafts. On supported terminals, preview local image attachments in the composer and open viewed images from clickable transcript paths
  • API key and cloud provider options are grouped under "Sign in another way". Enable gcp_setup_wizard to set up Google Cloud Vertex AI with Application Default Credentials or a credential file. /experimental can also opt into macOS or Windows system proxy settings
  • Fixes: saved chats stay visible after you switch model providers, Ctrl+L clears the terminal display while earlier messages stay available through Ctrl+T, and network approval prompts close when their requests end
  • Verification: the CLI argument definitions (main.rs, mcp_cmd.rs, and the TUI and exec cli.rs files) were compared between 0.166.0 and 0.167.0. No subcommands or global options were added or removed, so the count stays at 73. The only differences are the changed codex agents description and its new acceptance of --no-daemon, reflected in the codex-agents and no-daemon entries
codex-cli 0.166.0 (October 29, 2026)

View official release

  • Adds codex queue --resume, which resumes an unloaded thread on the local daemon or the --remote server after queueing a message. Startup options such as --worktree, --sandbox, and --model are no longer listed in codex queue --help
  • Adds codex doctor --network-only to diagnose only the config, network environment, provider HTTP, and Responses WebSocket
  • The TUI adds keyboard-driven transcript selection (word, line, and page motions, search, and configurable shortcuts), plus clearer safety-block explanations with selectable safer follow-up prompts. GPT-6.1 Terra is added to the Vertex AI and Amazon Bedrock model catalogs
  • Fixes: resuming or forking a thread keeps acknowledged approval and permission settings, reasoning-token accounting carries across resume and fork to avoid premature compaction, and unarchiving a parent restores its spawned descendant threads
  • Verification: codex --help and the main subcommands' --help were fetched with npx for 0.165.0 and 0.166.0 and diffed. Top-level subcommands and global options are unchanged, so the count stays at 73 (the codex queue and codex doctor options were updated)
codex-cli 0.165.0 (October 27, 2026)

View official release

  • A built-in Google Cloud Vertex AI provider, configured with model_provider = "gcp". GPT-6.1 Terra is added to the model catalogs
  • The session picker adds a repository filter and the agent command center groups sessions by directory, making sessions across linked worktrees easier to find. Changing reasoning effort mid-conversation is now on by default for supported models
  • Memory v2 is on by default for fresh profiles and can import memories from other agents
  • Fixes: queued agent messages no longer restart work after an interrupt or a switch to Plan mode; a provider's model-not-found error is no longer retried and its message is kept; a marketplace URL validation gap that could let Git connect to a host other than the one checked is closed
  • Verification: the CLI argument definitions (main.rs, the exec and TUI cli.rs, and three more files) are identical between the rust-v0.164.0 and rust-v0.165.0 tags. No commands or options were added or removed, so the count stays at 73
codex-cli 0.164.0 (October 23, 2026)

View official release

  • /presets adds ten numbered slots for saving reusable prompts and slash commands, with a keyboard menu for quick access
  • Inline /model and /permissions arguments set the model, reasoning effort, speed, and permission profile directly. On terminals that support Kitty or Sixel graphics, the fullscreen transcript previews viewed and generated images
  • Enterprise MCP connections can authenticate with eligible Codex account grants or a dedicated sign-in. Credentials are masked during supported remote Bash commands and Zsh snapshot sessions. The Amazon Bedrock setup wizard is now on by default
  • Fixes: failed compaction no longer leaves partial summaries in conversation history; resuming a session finds compressed histories and restores saved thread settings; -c / --config overrides are kept when they appear at more than one subcommand level
  • Verification: the --help output of npx -y @openai/codex@0.164.0 and 0.163.0 (top level and every subcommand) was compared with diff. The only difference is the experimental codex migrate-nfs-db subcommand, now added to Core Commands (72 to 73 entries)
codex-cli 0.163.0 (October 15, 2026)

View official release

  • /config now searches preferences across categories, applies supported settings immediately, and shows which changes require a restart
  • Send a follow-up while Codex is responding to steer it immediately (instant interrupts are on by default). /keymap can configure a leader key (default Ctrl+X; voice mute moves to F9)
  • Restart a managed background server from /daemon. Independent read-only tools (skill, memory, and conversation-history lookups) can run in parallel. Daybreak is enabled by default for eligible accounts
  • Fixes: resuming a saved thread restores its permissions and network approvals; /side returns to an existing side conversation after switching threads; Ctrl+V and Shift+Insert paste text on Windows; codex exec no longer prints the same diff again after an unrelated command
  • Verification: the --help output of npx -y @openai/codex@0.163.0 and 0.162.1 (top level and every subcommand) was compared with diff. No flags or subcommands were added or removed, so the page stays at 72 entries
codex-cli 0.162.1 (October 9, 2026)

View official release

  • Fix: a TUI crash when asynchronous questions contain multiple lines is resolved, preserving line breaks and complete hyperlink destinations
  • Fix: startup failures caused by differences between a running background server's feature settings and CLI defaults are resolved; compatibility checks now apply only to explicit command-line feature overrides
  • Verification: the --help output of npx -y @openai/codex@0.162.1 and @0.161.0 (top level and every subcommand) was compared with diff. The only difference is codex sandbox uninstall, noted in the codex-sandbox options (the page stays at 72 entries)
codex-cli 0.162.0 (October 8, 2026)

View official release

  • codex sandbox uninstall removes the legacy Windows sandbox's machine-wide accounts and network rules
  • Tools for creating and listing managed Git worktrees from trusted local projects when the worktrees feature is enabled, and task pinning with p in the agent Command Center
  • Navigate and copy transcript blocks with /copy, copy selections with Ctrl+Insert, and tune mouse-wheel scrolling with tui.mouse_scroll_speed. URLs in approval headers, questions, MCP prompts, and warnings are now clickable
  • Configure live web access and remote compaction capabilities for custom Responses-compatible model providers. Code Mode gains promise-settlement streaming helpers and opt-in ranked tool search
  • Fix: new TUI threads respect server model and reasoning-summary defaults, apply_patch preserves existing CRLF line endings, Linux sandbox startup with multiple denied files, Windows 10 drive-letter file access, and honoring server Retry-After advice
codex-cli 0.161.0 (October 7, 2026)

View official release

  • GPT-6.1 Sol is now the default model in the bundled and Amazon Bedrock catalogs, and Amazon Bedrock supports multi-agent V2 and Ultra reasoning
  • Sign in to MCP servers from an active session with /mcp login <name>, and choose the microphone, speaker, and input channels for voice conversations
  • Select a Cyber access program per turn with codex exec --cyber-access-program <PROGRAM> (experimental, OpenAI provider only). Daybreak is now opt-in through --enable cli_daybreak or features.cli_daybreak=true
  • Fix: approved filesystem escalation can grant broader write access while keeping denied reads and network restrictions; Enter submitting buffered input after paste detection and thread resume missing the latest history are also fixed
  • Verification: the --help output of npx -y @openai/codex@0.161.0 and @0.160.1 (top level and every subcommand) was compared with diff. The only difference is codex exec --cyber-access-program, now added to Key Options (71 to 72 entries)
codex-cli 0.160.1 (October 5, 2026)

View official release

  • Fix: remote stdio MCP servers launched with explicitly configured remote environment variables now keep SYSTEMROOT, TEMP, and TMP, so Unix hosts retain the Windows executor's startup environment
  • Verification: the CLI argument definitions of rust-v0.160.0 and rust-v0.160.1 (main.rs, mcp_cmd.rs, exec_server_command.rs, and the TUI and exec cli.rs) were compared and are identical; the release notes list no new subcommands or global options (the page stays at 71 entries)
codex-cli 0.160.0 (October 1, 2026)

View official release

  • The agent command center lists older tasks behind a keyboard-accessible "Show more" action; fullscreen mode supports selecting transcript text and pasting with middle-click on supported local Linux X11 terminals
  • Sessions can start outside a project with workspace defaults when policy permits, and saved permissions are restored when you resume; opt-in Guardian review can retrieve earlier user instructions and include context from agent handoffs
  • Fixes: unsent queued messages resume after reconnection without duplicate sends; the terminal UI keeps server provider, reasoning-summary, and verbosity settings and shows the correct sessions in resume and fork history; subagents keep environments that are still starting and receive their preparation failure; SQLite stalls and masked initialization errors were fixed; explicit provider model catalogs no longer include unsupported bundled models; Windows sandbox PowerShell fallbacks and long-path permission repairs were fixed
  • Verification: the CLI argument definitions of rust-v0.159.3 and rust-v0.160.0 (main.rs, mcp_cmd.rs, exec_server_command.rs, and the TUI and exec cli.rs) were compared and are identical; the release notes list no new subcommands or global options (the page stays at 71 entries)
codex-cli 0.159.3 (September 30, 2026)

View official release

  • Highlights of 0.159.0 (September 29, 2026): opt-in instant_interrupt lets new input steer Codex during model responses or long-running code-mode calls; new sessions get a compact welcome screen with occasional tips; the warnings viewer dismisses reviewed warnings when closed (press k to keep one); you can scroll the transcript while deciding whether to implement a plan; native Mermaid rendering supports more flowchart edges, labels, and node groups; .aws directories are protected by default under writable roots; automatic follow-up prompt suggestions and the tui.prompt_suggestions setting were removed
  • Highlights of 0.158.0: copy-on-select and right-click paste can be configured in the fullscreen TUI, MCP servers that require pre-registered OAuth client secrets are supported (including codex mcp add --oauth-client-secret), and direct exec-server WebSocket connections can be secured with bearer tokens (codex exec-server gained --ws-auth and related options plus --linux-sandbox-pid-namespace). Image generation can request transparent backgrounds, and terminal input approval is enabled by default for commands with elevated permissions
  • 0.159.1 added GPT-6.1 Sol as the default model in the bundled catalog and the Amazon Bedrock catalogs; 0.159.2 suppressed console windows flashing on Windows when background processes and sandboxed commands launch; 0.159.3 can show optional account security setup reminders to eligible local sessions signed in with ChatGPT
  • Verification: the local codex-cli 0.158.0 --help output was compared with 0.157.1 for the top level and every top-level subcommand; the only subcommand and option difference is the new codex exec-server options. The 0.159.x releases were checked against their release notes only, which list no new subcommands or global options (the page stays at 71 entries)
codex-cli 0.157.1 (September 26, 2026)

View official release

  • Highlights of 0.157.0 (September 25, 2026): GPT-6 Sol and Luna (including Amazon Bedrock support and migration prompts for older models), the fullscreen transcript on by default with Shift-click to extend selections, automatic background-server startup for eligible interactive sessions with recovery choices when server settings are incompatible, an f shortcut to fork conversations open in another app while keeping drafts and queued prompts, /import in remote sessions and local background-server sessions, and terminal rendering with Unicode bullets, checkboxes, and aligned equations
  • 0.157.1 (September 26, 2026) is a maintenance release whose notes list no changes. codex --help and the --help output of every top-level subcommand and its nested subcommands were compared against 0.156.1 with no differences in subcommands or options (the page stays at 71 entries)
  • Fixes: active voice conversations survive thread switches, unsent question answers are recovered into the composer when turns end, tmux mouse settings are respected and native scrollback is restored for Terminal.app over SSH, configured proxies are honored for realtime connections and standalone web search, transient file-upload failures are retried with a five-minute timeout, and network restrictions are enforced across redirects and ongoing HTTP and WebSocket traffic
codex-cli 0.156.1 (September 23, 2026)

View official release

  • Highlights of 0.156.0 (September 22, 2026): an optional fullscreen UI chosen with /tui for your next launch (transcript search, mouse selection, right-click copy), voice conversations on by default with an F8 toggle and /voice settings, a /usage dashboard for account usage, token totals, and plugin and skill activity, worktree support enabled by default, and six new themes plus inline Mermaid diagrams and display equations
  • Update the local background server through /daemon, or bypass it with the new global option --no-daemon, now added to this reference (70 to 71 entries; options 29 to 30)
  • codex mcp login gained --no-browser (print the authorization URL and accept the callback URL without opening a browser), and codex app-server daemon update is now described as updating the daemon package, which may interrupt running work
  • Streamed answers and plans are preserved when turns fail or are interrupted, clipboard forwarding works in tmux and SSH, Plan mode is restored on resume, and sandbox isolation is tightened on Windows, Linux, and macOS
codex-cli 0.155.1 (September 18, 2026)

View official release

  • New local TUI sessions once again leave reasoning summaries disabled by default, fixing request rejections from providers that do not support them. Explicit reasoning-summary settings are still respected. Subcommands and global options are unchanged, so the page stays at 70 items
codex-cli 0.155.0 (September 17, 2026)

View official release

  • Added codex app-server daemon update (update the standalone installation and restart the managed daemon) with configurable daemon update schedules; saved threads and active goals now recover after daemon restarts. codex plugin marketplace --help now prints its own help (add / list / upgrade / remove). Top-level subcommands and global options are unchanged, so the page stays at 70 items
  • Added experimental /voice conversations with live transcripts and microphone controls (enabled through /experimental), live reasoning summaries in the TUI status row plus completion timestamps, task hiding/archiving/deletion and worktree ownership details in the agents overview, and Touch ID verification for MCP requests on supported Macs
  • Amazon Bedrock can obtain AWS credentials from configured commands (with caching, expiration-based refresh, and authentication recovery). MCP servers now report expired OAuth credentials accurately with reconnect guidance, and switching accounts invalidates the previous identity's remote-control sessions, WebSocket state, and model catalogs
codex-cli 0.154.0 (September 9, 2026)

View official release

  • The deprecated codex mcp-server entry point (running Codex as an MCP server over stdio) is no longer available; this reference drops that entry, keeping 70 items in total while config goes 7→6 and options 28→29
  • Experimental worktree support lets you create isolated checkouts for new or forked sessions with --worktree or /worktree, then browse and resume them
  • codex exec-server gained AWS SigV4 signing options (--remote-transport, --aws-sigv4, --aws-profile, --aws-region, --aws-service)
  • You can answer questions inline while Codex keeps working, using suggested choices or custom text without losing your main draft
  • Windows sessions can share a background Codex server, with daemon lifecycle commands and managed updates
  • /copy can copy status output or individual session fields, and copied responses keep their formatting when pasted into rich-text apps
codex-cli 0.153.4 (September 4, 2026)

View official release

  • Fixed Astra's visibility in the bundled model picker and made it the bundled default when no model is explicitly configured
  • Qualified Astra's async-question guidance to apply only when the tool is available in the session
  • No changes to CLI subcommands or global options — all 70 commands in this reference remain accurate
codex-cli 0.153.3 (September 4, 2026)

View official release

  • Added GPT-6-Astra to the Amazon Bedrock model picker for Mantle and Runtime global/US routes
  • Corrected Astra's guidance for asynchronous clarification questions to use the supported tool and recognize that it accepts text only
  • No changes to CLI subcommands or global options — all 70 commands in this reference remain accurate
codex-cli 0.153.2 (September 3, 2026)

View official release

  • Bug fix: corrected the GPT-6-Astra Fast tier description from “1.5x speed” to “2x speed, increased usage” — a display-text-only change with no effect on how requests run
  • No changes to CLI subcommands or global options — all 70 commands in this reference remain accurate
codex-cli 0.153.1 (September 3, 2026)

View official release

  • Added support for configuring GPT-6-Astra through the API, without changing the default model or its visibility in the model picker
  • No changes to CLI subcommands or global options — all 70 commands in this reference remain accurate
codex-cli 0.153.0 (September 3, 2026)

View official release

  • Vim mode composer drafts (including pasted content and attachments) can now be undone (u) and redone (Ctrl+R)
  • The plugin CLI (e.g. codex plugin marketplace add) can now list, install, and remove plugins from remote marketplaces
  • Set tui.auto_recap = false to disable automatic recaps while keeping manual /recap available
  • Plus and Team users now get an earlier warning when less than half of their roughly five-hour usage allowance remains
  • Bug fix: TUI sessions now reconnect after an external app-server connection drops, preserving drafts and transcripts
  • No changes to CLI subcommands or global options — all 70 commands in this reference remain accurate
codex-cli 0.152.1 (September 1, 2026)

View official release

  • Bug fix: Guardian approval review now honors the Node REPL policies supplied through model metadata
  • No changes to CLI subcommands or global options — all 70 commands in this reference remain accurate
codex-cli 0.152.0 (September 1, 2026)

View official release

  • Vim mode gained / and ? search motions, with match highlighting and n / N navigation between hits
  • Rate-limit banners now offer direct actions for checking usage, managing credits, seeing when limits reset, and managing your plan
  • Approval reviews and codex exec now show progress while credentials are refreshed, including Amazon Bedrock reauthentication
  • MCP server names can now contain colons, @, slashes, and dots
  • Individual MCP tools can now set an output_token_limit (configured through the config file, so outside the command scope of this reference)
  • app-server clients can now configure thread and shellCommand timeouts, including values beyond one hour
  • No changes to CLI subcommands or global options — all 70 commands in this reference remain accurate
codex-cli 0.151.0 (August 29, 2026)

View official release

  • Optional MCP servers now let you configure how long Codex waits for their tools to be discovered (configured through the config file, so outside the command scope of this reference)
  • Extensions can now inspect and replace MCP tool results before they reach the model
  • The plugin catalog now merges per-repository configuration and warns about individual invalid project marketplaces instead of failing outright
  • Bug fixes (permissions and sandbox): permission profiles are restored between TUI turns, /cd can no longer weaken sandbox restrictions, stale Guardian classifications no longer authorize actions after a permission state change, and remote sandboxes enforce based on the execution environment
  • Bug fixes (other): tool availability and reasoning effort survive model switches and fallbacks, app-server responses preserve structured MCP errors, and subagent token usage counts toward the root target budget
  • No changes to CLI subcommands or global options — all 70 commands in this reference remain accurate
codex-cli 0.150.1 (August 27, 2026)

View official release

  • Bug fix: remote compaction now counts retained images toward its token budget by default, trimming older images first as needed (#41003)
  • No changes to CLI subcommands or global options — all 70 commands in this reference remain accurate
codex-cli 0.150.0 (August 26, 2026)

View official release

  • No changes to CLI subcommands or global options — verified against the live output of codex --help, codex exec --help, and codex sandbox --help as well as the rust-v0.149.1...rust-v0.150.0 source diff — so all 70 commands in this reference remain accurate
  • New: Interrupt hooks — run a command or an MCP handler whenever an active top-level turn is interrupted (configured through the config file, so outside the command scope of this reference)
  • Security fixes: untrusted projects no longer supply project-level AGENTS.md instructions, and managed deny-read rules stay enforced after permission changes
  • The TUI gained @ mentions for referencing other Codex tasks, a /copy picker covering full responses, individual code blocks, and blockquotes, automatic titles for unnamed tasks with /rename suggestions, and keybindings for cycling permission modes (outside the CLI scope of this reference)
codex-cli 0.149.1 (August 24, 2026)

View official release

  • New: codex exec --thread-source <SOURCE> — a global option that classifies the source of newly created or forked threads (defaults to user); accepts subagent, memory_consolidation, or any custom feature name
  • The TypeScript SDK exposes the same option as threadSource. It applies only when a thread is created, so resuming an existing thread keeps its stored value
  • Added the compaction_image_budget feature, which counts retained images against the remote compaction context budget (an under-development feature that is disabled by default, so it is outside the command scope of this reference)
codex-cli 0.149.0 (August 20, 2026)

View official release

  • New: codex agents — an interactive dashboard for searching, starting, opening, renaming, and stopping agent sessions on the shared local app-server daemon
  • New: codex queue — queue a message for an existing local or remote session (--thread and --message are required)
  • Changed: untrusted was removed from -a / --ask-for-approval, leaving on-request and never
  • codex doctor now also diagnoses endpoint protection, network and proxy failures, desktop app state, and update connectivity
  • The TUI gained /cd, /pwd, and /cwd for managing the working directory, and Vim editing now covers character replacement and change motions such as cw, c$, and cc (outside the CLI scope of this reference)
codex-cli 0.148.0 (August 18, 2026)

View official release

  • Added codex migrate-rollouts — inspects or migrates legacy local sessions to paginated thread history (reports eligible sessions by default; --apply publishes the migration)
  • Added codex exec fork — fork a previous session by id into a new session non-interactively
  • The TUI also gained /export for Markdown conversation export, session archive/restore from the resume picker, and an Amazon Bedrock Runtime provider option (outside this CLI reference's scope)
codex-cli 0.147.0 (August 7, 2026)

View official release

  • Added the --approve-for-me flag to route approval requests through automatic review using the workspace-write sandbox
  • Added portable Agent Plugins installation and search across local, personal, workspace, and remote plugin catalogs
  • Added persistent, manually ordered conversation sections and incremental browsing of long transcripts
  • Added Cursor-managed skill imports and duplicate-free syncing of imported Claude and Cursor conversations
  • Added support for the opt-in MCP 2026-07-28 protocol, including paginated discovery, multi-round requests, and non-blocking server startup
  • Enabled cached web search and remote conversation compaction for Amazon Bedrock
  • Removed the deprecated codex exec --full-auto flag; use --sandbox workspace-write instead
codex-cli 0.146.1 (August 5, 2026)

View official release

  • Applied safer automatic-review defaults for cyber-capable models
  • The terminal interface now explains permission changes when they are applied
codex-cli 0.146.0 (July 29, 2026)

View official release

  • Set session names via /new and /clear for pinning and switching between threads
  • Added Agent Plugins manifest support and workspace plugin publishing
  • Added plugin marketplaces for Amazon Bedrock and Claude Code
  • Added paginated thread forking
  • app-server can now connect to remote Code Mode hosts over WebSocket
  • Enabled standalone web search for compatible custom model providers
codex-cli 0.145.0 (July 21, 2026)

View official release

  • Expanded /import to migrate Cursor and Claude Code settings, MCP servers, plugins, sessions, commands, and project-scoped memories
  • Stabilized the opt-in multi-agent V2 experience with configurable sub-agent models, reasoning levels, concurrency, restored roles, and improved agent navigation
  • Added experimental paginated thread history with efficient resume, search, persisted names, sub-agent support, and memories
  • Added audio inputs and tool outputs (common local audio formats) and introduced streaming realtime V3 conversations
  • Added experimental Amazon Bedrock login with custom endpoint and authentication support, and GPT-5.6 Sol as the default Bedrock model
codex-cli 0.144.6 (July 18, 2026)

View official release

  • Hotfix refreshing the bundled instructions for GPT-5.6 Sol, Terra, and Luna, and correcting their context window to 272,000 tokens
codex-cli 0.144.5 (July 16, 2026)

View official release

  • Improved dangerous-command detection, including more forced rm forms, with clearer rejection reasons when commands are denied
codex-cli 0.144.1 (July 9, 2026)

View official release

  • Fixed standalone installs failing when GitHub returns compact or reordered release metadata
  • Ensured macOS package installs expose the code-mode host binary alongside the codex executable
  • Kept code mode working when the companion host binary is unavailable by falling back to the embedded runtime
codex-cli 0.144.0 (July 9, 2026)

View official release

  • MCP tools can now request OAuth authentication interactively without an experimental opt-in; use codex mcp login <name> / codex mcp logout <name> to authenticate or deauthenticate a server
  • Added a writes app-approval mode that allows declared read-only actions while prompting for writes
  • Usage-limit reset credits now show their type and expiration, letting you choose which credit to redeem
  • Windows sandbox sessions can now delete files in writable roots and access the managed primary runtime
  • Pasted terminal control sequences can no longer corrupt TUI rendering or resumed conversation history
codex-cli 0.143.0 (July 8, 2026)

View official release

  • Remote plugins are now enabled by default, adding npm marketplace sources, richer catalog rows, and visible remote/local versions
  • Routes authentication and Responses API traffic through macOS and Windows system proxies, including PAC and WPAD configurations
  • Added codex remote-control pair to generate short-lived manual pairing codes from a running daemon
  • Added Amazon Bedrock GPT-5.6 Sol, Terra, and Luna models with first-class support for max reasoning effort
  • MCP tools now use tool search by default, and ChatGPT-hosted MCP servers can explicitly use session authentication
codex-cli 0.142.5 (July 1, 2026)

View official release

  • Fixed an issue where full Responses WebSocket request payloads could be written to trace logs, preventing accidental exposure of sensitive data
codex-cli 0.142.2 (June 25, 2026)

View official release

  • MCP tools now use tool search by default on supported servers, improving tool discovery while staying compatible with older models and providers
  • Plugins can ship dedicated dark-mode logos via local manifests and remote catalogs
  • macOS authentication can honor system proxy, PAC, and WPAD settings when respect_system_proxy is enabled
  • Remote HTTP(S) image inputs now return clear model-visible validation errors; inline data URLs and local images remain supported
codex-cli 0.142.1 (June 25, 2026)

View official release

  • Added opt-in Windows system proxy support for authentication, including PAC, WPAD, static proxies, and bypass rules
codex-cli 0.142.0 (June 22, 2026)

View official release

  • /usage can now show and redeem earned usage-limit reset credits, with confirmation, retry, and refreshed availability states
  • /plugins now organizes remote plugins into OpenAI Curated, Workspace, and Shared with me sections, while eligible turns can recommend and install relevant plugins
  • Configurable rollout token budgets track usage across agent threads, provide remaining-budget reminders, and abort turns when exhausted
  • App-server clients can configure multi-agent delegation as disabled, explicit-request-only, or proactive at the thread and turn level
  • Added an indexed web-search mode that permits live searches while restricting direct page access to server-approved URLs
  • Codex can now receive scheduled UTC time reminders and query the current time directly, including through client-provided app-server clocks
  • Bug fixes: restored Linux TUI rendering after suspending with Ctrl+Z and resuming with fg, exec-server processes and stdio MCP sessions now survive transient disconnects (including signed-URL refresh and retry-safe stdin writes), and parent agents now receive terminal subagent errors instead of seeing failed work as an empty successful completion
codex-cli 0.141.0 (June 18, 2026)

View official release

  • Remote executors now use authenticated, end-to-end encrypted Noise relay channels, and cross-platform remote execution preserves executor-native working directories and shells (including filesystem permission paths) across the app-server and exec-server boundaries
  • Selected executor plugins can activate their stdio MCP servers per thread; plugin discovery also adds a created-by-me marketplace and auth-specific curated catalogs
  • App-server clients can list immediate child threads, correlate external-agent imports with detailed results, and read or redeem rate-limit reset credits
  • Realtime clients can explicitly append speech, control how Codex responses enter conversations, and omit startup context
  • TUI input prompts can auto-resolve after inactivity, with a countdown that pauses on interaction
  • Bug fixes: hook-trust bypass now persists through codex exec thread start and resume while blocking PostToolUse hooks correctly reject code-mode tool calls, Windows sandbox execution repairs stale credentials automatically, bundled SQLite is pinned to a WAL-reset corruption fix, and TLS now supports P-521 certificate signatures used by enterprise proxies. The default MCP tool timeout increased to 300 seconds
codex-cli 0.140.0 (June 15, 2026)

View official release

  • Added permanent session deletion via codex delete <SESSION>, /delete, and app-server thread/delete, with confirmation safeguards and subagent cleanup; use --force to skip the prompt (UUID required)
  • Added /usage views for daily, weekly, and cumulative account token activity
  • Added /import to selectively pull setup, project configuration, and recent chats from Claude Code
  • Typing @ now opens the unified mentions menu for files, plugins, and skills by default; added managed Amazon Bedrock API-key authentication and encrypted local storage for CLI and MCP OAuth credentials
  • Bug fixes: corrupted SQLite state databases are backed up and rebuilt automatically from rollout data, /review no longer crashes on Esc with queued guidance, and non-TTY background commands can be interrupted with Ctrl-C. Removed the experimental /realtime voice controls from the TUI
codex-cli 0.139.0 (June 9, 2026)

View official release

  • codex sandbox gained -P, --permission-profile <name> to apply a named permissions profile defined in the configuration stack when running a command
  • Code mode can now call standalone web search directly, including from nested JavaScript tool calls, and receive plaintext search results
  • Tool and connector input schemas preserve oneOf and allOf, and large schemas keep more shallow structure when compacted, improving compatibility with richer MCP tools
  • codex doctor includes editor and pager environment details in the local report while redacting raw values in JSON output, and plugin lists return from the cached remote catalog before refreshing in the background
  • Bug fixes: codex resume --last "..." and codex fork --last "..." treat the trailing argument as the initial prompt instead of a session ID, subagent MCP startup warnings stay in their owning thread, image edits use the exact referenced file paths, and /new, /clear, and /fork no longer drop cloud requirements or feature flags
codex-cli 0.138.0 (June 8, 2026)

View official release

  • The /app command can hand off the current CLI thread to Codex Desktop on macOS and native Windows, and Windows workspace launches open directly into Desktop instead of stopping at a manual prompt
  • Local image attachments and standalone image generations now expose their saved file paths to the model, making follow-up edits and file references more reliable
  • Plugin automation gained richer structured output: codex plugin add / remove / marketplace commands support --json, plugin list JSON includes the marketplace source, and plugin detail exposes default prompts, remote MCP servers, and unavailable app templates
  • Reasoning effort selection is more flexible, with TUI fallback shortcuts for terminals missing Alt bindings and model-defined effort levels flowing through in the order the model advertises
  • App-server integrations can read account token usage, and Codex auth supports v2 personal access tokens across CLI and app-server flows
  • Bug fixes: multiline paste in /goal edit no longer submits early, idle auto-turns stay out of Plan mode, forked threads keep user-renamed titles, the TUI avoids extra blank space while streaming, and AGENTS.md loading is accurate for remote and symlinked workspaces
codex-cli 0.137.0 (June 4, 2026)

View official release

  • TUI keymaps now support F13-F24 function keys, allow pasting inside searchable selection menus, and add a compact reasoning-only status item
  • Plugin workflows gained machine-readable codex plugin list --json output and cached remote catalog suggestions
  • Remote-control clients can start pairing and list or revoke controller grants through app-server v2 RPCs
  • Hosted web and image tools are available in more code-mode flows, with standalone web searches able to run in parallel
  • Enterprise/admin flows now show monthly credit limits and can apply cloud-managed config bundles, including EDU workspaces
  • Bug fixes: cancelling a prompt before visible output restores the draft, attachments, and collaboration mode; slash-command filtering and footer shortcut hints reset to the current UI state; macOS app launch and Windows SQLite startup reliability improved; duplicate local/remote plugin installs are deduplicated
codex-cli 0.136.0 (June 1, 2026)

View official release

  • Added session archiving: archive and restore sessions from the TUI with /archive or from the CLI with codex archive / codex unarchive; archived sessions are protected from resume/fork until restored
  • TUI markdown now keeps web links clickable with OSC 8 metadata, and cramped tables switch to readable key/value records without losing link targets
  • App-server integrations can launch stdio mode with codex app-server --stdio, resume a thread with its initial turns page, and see richer MCP server status
  • Remote execution setup now supports CODEX_API_KEY registration, while remote-control websockets use short-lived server tokens instead of ChatGPT access tokens
  • Windows admins get an alpha codex sandbox setup --elevated provisioning path
  • Bug fixes: ChatGPT auth refreshes tokens before the five-minute expiry window, /diff no longer runs repository-provided Git helpers/hooks, resumed TUI sessions seed prompt history from the transcript, and Vim normal-mode editing behaves correctly
codex-cli 0.135.0 (May 28, 2026)

View official release

  • Richer codex doctor diagnostics: reports environment, Git, terminal, app-server, and thread inventory details for support cases
  • /permissions now understands named permission profiles and displays configured custom profiles
  • Vim mode gained text-object editing, improved word/line-end behavior, and a configurable interrupt-turn binding
  • /status shows remote connection details and server version when connected over a remote transport
  • install.sh / install.ps1 support a non-interactive installation mode when CODEX_NON_INTERACTIVE=1 is set
  • Bug fixes: more readable markdown tables and multiline lists in the TUI, stable output on macOS and Zellij, slash-command completion preserves draft text, and older tmux/iTerm sessions keep normal Ctrl-C handling
codex-cli 0.134.0 (May 26, 2026)

View official release

  • Made --profile the primary profile selector across CLI, TUI, and sandbox flows; the legacy --profile-v2 flag was removed and legacy profile configs are rejected with migration guidance
  • Added thread search across local conversation history, with case-insensitive content matching and result previews
  • Improved MCP setup with per-server environment routing and OAuth options for streamable HTTP servers
  • Let read-only MCP tools that advertise readOnlyHint run in parallel
  • Preserved local $ref / $defs structures in connector tool schemas, and compacted oversized schemas before exposing them
  • Richer extension and hook context: conversation history available to extension tools, and subagent identity passed to hook inputs
  • Bug fixes: reconnect stale exec-server websocket clients with fresh sessions, retry remote control immediately after auth recovery, retry remote compaction v2 streams, fix Windows TUI rendering corruption, and surface workspace-specific usage-limit messages
codex-cli 0.133.0 (May 21, 2026)

View official release

  • Goals are now enabled by default, backed by dedicated storage and tracking progress across active turns
  • codex remote-control UX overhaul: now runs like a foreground command, waits for readiness, reports machine status, and keeps explicit start / stop daemon subcommands
  • Stronger permission profiles: list APIs, inheritance, managed requirements.toml support, runtime refresh behavior, and tighter Windows sandbox integration
  • Easier plugin discovery: marketplace-aware list output, installed versions, visible marketplace roots, and remote collection support
  • Extensions can observe more lifecycle events (subagent start/stop, tool execution, turn metadata, async approval/turn processing)
  • Bug fixes: TUI startup no longer picks the wrong working directory when reusing a local app-server socket, plan-mode Shift+Enter no longer submits, more reliable AGENTS instruction loading, app-server startup/shutdown races and plugin upgrade failures resolved
codex-cli 0.132.0 (May 20, 2026)

View official release

  • codex exec resume now accepts --output-schema, so resumed automations keep session context while enforcing structured JSON output
  • The Python SDK gained first-class authentication: API key login, ChatGPT browser and device-code flows, account inspection, and logout APIs
  • Python turn APIs accept a plain string as input and return a richer TurnResult with collected items, timing, and usage data
  • Faster TUI startup by batching terminal capability probes instead of running them serially
  • Remote executor registration can now use standard Codex auth instead of a separate registry credential flow
  • App-server turns preserve requested image fidelity, including original-resolution local images
  • Bug fixes: goal continuations stop at usage limits and repeated blockers to avoid burning tokens, session picker paste/rename hints, remote websocket keepalive, Windows codex doctor npm detection, and MSVC static-CRT linking
codex-cli 0.131.0 (May 18, 2026)

View official release

  • New subcommand codex doctor for support-ready diagnostics across runtime, auth, terminal, network, config, and local state (--summary / --json / --all)
  • New option --strict-config: error out when config.toml contains unrecognized fields to catch config mistakes early
  • New option --profile-v2: layer $CODEX_HOME/<name>.config.toml on top of the base user config
  • New option --dangerously-bypass-hook-trust: run hooks without requiring persisted trust (for vetted automation only)
  • Richer TUI session controls and display: service-tier commands, blended token usage, permissions/approval mode, effective workspace roots, and responsive Markdown tables
  • @ mentions now search files, directories, plugins, and skills in a single picker
  • Plugin workflows gained marketplace CLI commands, version-aware sharing, share checkout, and default-enabled plugin hooks
  • Remote workflows now support daemon-managed codex remote-control, runtime enable/disable APIs, status reads, and registry-backed/configured remote environments
  • The Python SDK moved to openai-codex / openai_codex, with pinned runtime-generated types, concurrent turn routing, and approval modes
codex-cli 0.130.0 (May 8, 2026)

View official release

  • New codex remote-control subcommand launches a headless, remotely controllable app-server with a simpler entry point than codex app-server
  • Plugin details now show bundled hooks; plugin sharing exposes link metadata and discoverability controls
  • Bedrock auth can use AWS console-login credentials from aws login profiles
  • App-server clients can page large threads with unloaded, summary, or full turn-item views
  • view_image can resolve files through the selected environment in multi-environment sessions
  • Live app-server threads now pick up the latest config snapshot without a restart
  • Turn diffs stay accurate across apply-patch operations, including partial failures that mutated files
  • Remote compaction emits response.processed for v2 streams and avoids sending service_tier on API-key compact requests
  • Windows sandbox setup grants sandbox users access to the desktop runtime binary cache
  • Removed stale "research preview" wording from the codex exec startup banner
codex-cli 0.129.0 (May 7, 2026)

View official release

  • TUI composer gains modal Vim editing: /vim, default-mode config, and Vim-specific keymap contexts
  • Redesigned resume/fork picker with raw scrollback mode, /ide context injection, and workspace-aware /diff
  • Status line shows theme-aware colors plus optional PR and branch-change summaries; /keymap debug inspects terminal key events
  • Plugin management adds workspace sharing, share access controls, source filtering, local share path tracking, marketplace removal/upgrades, remote bundle sync, and admin-disabled status handling
  • Hooks browser via /hooks, before/after compaction hooks, and PreToolUse context for richer lifecycle integration
  • Experimental /goals are now discoverable, stay paused across resume unless the user opts back in, and show clearer validation and multi-day duration output
  • macOS /copy works better in tmux; Alt+Enter and modified Delete/Backspace behave correctly; Windows typing/paste latency was reduced
  • Linux sandbox startup is more reliable across older bwrap, slow mount probes, symlink-protected paths, and shared /tmp setups; standalone bwrap fallback now built and verified for Linux releases
  • Windows sandbox and exec policy fixes for named pipes, ConPTY teardown, PowerShell-wrapped allow rules, worktree safe.directory, and unsafe Git options
  • Fixes for custom CA login behind TLS-inspecting proxies, Bedrock runtime endpoint reporting, dangerous project config keys, heredoc redirect approval matching, and unbounded MCP/hook output growth
codex-cli 0.128.0 (April 30, 2026)

View official release

  • New codex update subcommand upgrades the CLI to the latest release in one step (no manual reinstall required)
  • --full-auto is deprecated in favor of explicit permission profiles (combine --profile with --sandbox or pick a built-in profile)
  • Persisted /goal workflows: app-server APIs, model tools, runtime continuation, and TUI controls for create, pause, resume, and clear
  • TUI improvements: configurable keymaps, plan-mode nudges from composer drafts, action-required terminal titles, and active-turn /statusline and /title edits
  • Permission profiles add built-in defaults, sandbox CLI profile selection (codex sandbox), cwd controls, and active-profile metadata for clients
  • Plugin workflows: /plugins marketplace install flow, remote bundle caching, remote uninstall, plugin-bundled hooks, persisted hook enablement state, and external-agent config import
  • External agent session import, including background imports and imported-session title handling
  • MultiAgentV2 configuration: thread caps, wait-time controls, root/subagent hints, and v2-specific depth handling
  • Bug fixes: stale interrupt hangs, persisted provider restoration, large remote resume responses, TUI terminal-resize / markdown / shell-mode escape stability, Windows sandbox + PTY edge cases, git -C auto-approval handling, Bedrock GPT-5.4 reasoning levels
codex-cli 0.125.0 (April 24, 2026)

View official release

  • codex exec --json usage now includes reasoning tokens, enabling automated inference-cost accounting
  • Permission profiles persist across TUI sessions, user turns, MCP sandbox state, and shell escalation, keeping enforcement consistent across surfaces
  • Model providers now own model discovery; AWS/Bedrock account state is exposed to app clients
  • Remote plugin install writes plus an app-server marketplace upgrade RPC enable programmatic plugin marketplace management
  • Rollout tracing records tool, code-mode, session, and multi-agent boundaries; a debug command reduces traces for inspection
  • App-server adds Unix socket transport, pagination-friendly resume/fork, sticky environments, and remote thread config/store plumbing
  • Bug fixes: /review interrupt and TUI exit no longer wedge, exec-server retains buffered output, WebSocket bursts no longer drop clients, Windows sandbox startup stabilized
codex-cli 0.124.0 (April 23, 2026)

View official release

  • TUI reasoning controls: Alt+, lowers reasoning, Alt+. raises it; accepted model upgrades reset reasoning to the new model's default
  • Hooks promoted to stable: configurable inline in config.toml and managed requirements.toml; can observe MCP tools, apply_patch, and long-running Bash sessions
  • First-class Amazon Bedrock support for OpenAI-compatible providers, including AWS SigV4 signing and AWS credential-based auth
  • App-server sessions now manage multiple environments and choose an environment + working directory per turn (multi-workspace and remote setups)
  • Remote plugin marketplaces can be listed and read directly with more reliable detail lookups and larger result pages
  • Eligible ChatGPT plans default to the Fast service tier unless explicitly opted out
  • Cloudflare cookies preserved across approved ChatGPT hosts, reducing auth breakage in HTTP-backed ChatGPT flows
codex-cli 0.123.0 (April 23, 2026)

View official release

  • Built-in amazon-bedrock model provider with configurable AWS profile support
  • Added /mcp verbose for full MCP server diagnostics, resources, and resource templates while keeping plain /mcp fast
  • Plugin MCP loading accepts both mcpServers and top-level server maps in .mcp.json
  • Improved realtime handoffs: background agents receive transcript deltas and can explicitly stay silent when appropriate
  • Host-specific remote_sandbox_config requirements supported for remote environments
  • codex exec inherits root-level shared flags such as sandbox and model options
  • Fixed /copy after rollback so it copies the latest visible assistant response, not a pre-rollback response
codex-cli 0.122.0 (April 22, 2026)

View official release

  • Added codex plugin umbrella subcommand for managing Codex plugins
  • Moved marketplace management to codex plugin marketplace (add/upgrade/remove); the top-level codex marketplace command was removed
  • codex exec --ignore-user-config skips $CODEX_HOME/config.toml while preserving auth via CODEX_HOME
  • codex exec --ignore-rules ignores user and project execpolicy .rules files for isolated automated runs
  • Combine --ignore-user-config with --ignore-rules for deterministic, profile-free CI execution
codex-cli 0.121.0 (April 15, 2026)

View official release

  • Added codex marketplace add to install plugin marketplaces from owner/repo[@ref], HTTP(S)/SSH Git URLs, or local directories — with --ref and --sparse for precise checkout
  • TUI composer gains Ctrl+R reverse history search plus local recall for accepted slash commands
  • TUI and app-server add memory-mode controls, memory reset/deletion, and memory-extension cleanup
  • MCP gains namespaced tool registration, parallel-call opt-in, MCP Apps tool calls, and sandbox-state metadata delivered with each call
  • Realtime streams output modality, transcript completion events, and raw turn-item injection; app-server surfaces symlink-aware filesystem metadata
  • Secure devcontainer profile with bubblewrap support lands alongside macOS Unix-socket sandbox allowlists
  • Removed the danger-full-access denylist-only network mode and fixed macOS sandbox handling for private DNS
  • Fixed resume --last and thread/list when Windows paths use verbatim prefixes
codex-cli 0.120.0 (April 12, 2026)

View official release

  • Realtime V2 streams background agent progress and queues follow-up responses so long-running work stays interactive
  • TUI hook activity rendering improved: running hooks render in their own line and only useful output is retained after completion
  • Code-mode tool declarations now include MCP outputSchema details so structured results are typed accurately
  • Windows elevated sandbox supports split filesystem policies with read-only carveouts
  • Fixed a panic when using codex --remote wss://... by installing a Rustls crypto provider
codex-cli 0.119.0 (April 8, 2026)

View official release

  • Realtime voice sessions default to the v2 WebRTC path with richer transport, voice selection, and TUI media support
  • MCP apps and custom MCP servers support resource loading, tool-call metadata, and server-driven elicitation questions
  • Added experimental codex exec-server subcommand: a standalone WebSocket endpoint for remote and app-server workflows
  • /resume jumps directly to a session by ID or name without going through the picker
  • TUI notifications support Warp OSC 9 and add a focused-notification option
codex-cli 0.118.0 (April 4, 2026)

View official release

  • Windows sandbox can enforce proxy-only networking with OS-level egress rules instead of relying on environment variables alone
  • codex exec supports prompt-plus-stdin workflow: pipe input and still pass a separate prompt on the command line
  • Custom model providers can dynamically fetch and refresh short-lived bearer tokens instead of static credentials
  • App-server TUI fixes: /copy and /resume <name> work again, hook notifications replay correctly, skills picker scrolls past first page
  • MCP server startup improved: longer startup window for local servers and failed handshakes surface warnings again
codex-cli 0.117.0 (March 25, 2026)

View official release

  • Plugins integrated as a first-class workflow: sync, browse in /plugins, install, and remove with clearer auth handling
  • Sub-agents now use readable path-based addresses like /root/agent_a with structured inter-agent messaging
  • /title picker works in both classic TUI and app-server TUI for easier parallel session identification
  • App-server clients can connect to remote WebSocket servers with bearer-token auth (--remote-auth-token-env)
  • Image workflows improved: view_image returns URLs in code mode, generated images are reopenable, and history survives resume
codex-cli 0.116.0 (March 19, 2026)

View official release

  • App-server TUI now supports device-code ChatGPT sign-in during onboarding and can refresh existing ChatGPT tokens
  • Codex can prompt to install missing plugins or connectors, respect a configured suggestion allowlist, and sync install or uninstall state remotely
  • Added a userpromptsubmit hook to block or augment prompts before execution and before they enter history
  • Realtime sessions start with recent thread context and are less likely to self-interrupt during audio playback
  • Fixed first-turn websocket prewarm stalls, restored remote resume or fork history, and improved Linux sandbox startup
codex-cli 0.115.0 (March 16, 2026)

View official release

  • view_image and codex.emitImage(..., detail: "original") now support full-resolution images
  • JS REPL now exposes codex.cwd and codex.homeDir, and keeps tool/image references across cells
  • app-server v2 gained filesystem RPCs for read/write, copy, directory operations, and path watching
  • Review requests can be routed through the guardian subagent, with better sandbox/network inheritance for subagents
  • Fixed resume-time --profile persistence, TUI exit stalls, and related stability issues
codex-cli 0.114.0 (March 11, 2026)

View official release

  • Experimental code mode and hooks engine (SessionStart / Stop) are now available
  • Permission/profile compatibility improved for legacy workspace-write + sandbox settings
  • App-server health endpoints (/readyz, /healthz) and realtime handoff context were enhanced
  • Session resume and Linux tmux stability issues were fixed
codex-cli 0.113.0 (March 10, 2026)

View official release

  • Added request_permissions tool for in-turn permission escalation
  • Plugin UX expanded with list/uninstall support and improved mentions
  • app-server exec gained stdin/stdout/stderr streaming with TTY/PTY support
  • Cloud and session tooling received reliability and UX improvements
codex-cli 0.112.0 (March 9, 2026)

View official release

  • @plugin mentions in chat auto-include plugin context (MCP/app/skill)
  • Latest model catalog now surfaced in the TUI model picker
  • Skill permission profiles merged into sandbox policy for safer execution
  • JS REPL bindings now persist after a failed cell for smoother iteration
  • emitImage restricted to data: URLs only (security fix)
codex-cli 0.111.0 (March 5, 2026)

View official release

  • approval_policy now correctly takes precedence over sandbox_mode
  • codex cloud apply better supports git worktree workflows
  • Improved MCP server connection and authentication stability
codex-cli 0.110.0 (March 4, 2026)

View official release

  • Cancelled approval requests can now be re-issued cleanly
  • Added custom token reset to simplify auth recovery
  • Reliability improvements for long-running sessions (watchdog and related fixes)
codex-cli 0.109.0 (March 3, 2026)

View official release

  • Added codex mcp list for easier MCP inventory checks
  • Added sandbox_workspace_write.network_access support
  • codex exec --last-message-file can write final output to a chosen file
codex-cli 0.108.0 (March 3, 2026)

View official release

  • codex apply now leverages git apply --3way behavior
  • Risk evaluation is more strict to reduce unnecessary approvals
  • Improved Codex Cloud task integration stability
codex-cli 0.107.0 (March 2, 2026)

View official release

  • codex exec --include-plan-tool enables plan tool usage in exec mode
  • MCP auth failures now guide users toward codex mcp login
  • OAuth flow keeps using existing clients for better connection stability

About This Tool

This free OpenAI Codex CLI cheat sheet organizes 73 command, option, setup, and workflow entries into one searchable reference page, covering interactive sessions, one-shot codex exec tasks, MCP integration, sandbox configuration, and CI/CD automation. Filter by category, search by keyword, and copy snippets to adapt to your environment.

What You Can Check

  • CLI commands for starting interactive sessions, non-interactive exec, and resume workflows
  • Key global options including profile, sandbox mode, approval policy, guardian approval, and web search
  • Selected in-session operations explained in the FAQ and version history
  • Practical setup commands for login, MCP servers, shell completion, and config.toml overrides
  • Practical workflow examples to adapt for terminal tasks and CI/CD pipelines
  • Version update summaries showing what changed in each release

When It Helps

  • Looking up the correct codex exec flags before adding an automated code-review step to a GitHub Actions or GitLab CI pipeline
  • Comparing sandbox modes (read-only vs workspace-write) when deciding how much file-system access to grant Codex in a production codebase
  • Onboarding a teammate to Codex CLI by sharing a cheat sheet of exec, mcp add, and profile commands without them needing to read the full docs
  • Referencing the -a / --ask-for-approval options (on-request, never) when configuring how Codex pauses for confirmation in an interactive or scripted workflow
  • Checking the correct syntax for codex mcp add before wiring up a GitHub or Jira MCP server to a Codex workflow

FAQ

What does this OpenAI Codex CLI cheat sheet cover?

This page organizes 73 entries into Core Commands, Key Options, Setup, and Workflow Examples. They include codex exec, review, resume, MCP setup, and configuration flags. Search by command name, option, or example, then copy a snippet and adapt it to your environment.

What keyboard shortcuts and slash commands are available in Codex CLI?

Inside an interactive codex session you can use slash commands like /resume, /title, /plugins, /copy, and /help for quick navigation and session control. TUI keyboard shortcuts include Ctrl+C to cancel the current turn, Ctrl+D to exit, Ctrl+R for reverse history search (0.121.0+), and Alt+, / Alt+. to lower or raise reasoning depth (0.124.0+). The searchable copy cards cover CLI commands, options, setup, and workflows. Selected in-session operations are described in this FAQ and the version history; they do not have dedicated copy cards.

What is OpenAI Codex CLI?

OpenAI Codex CLI is an open-source terminal agent that can read, write, and execute code in your local project. It is distinct from the older Codex API model — the CLI is an agentic tool that runs tasks autonomously in your shell, with optional MCP server integration, sandbox controls, and approval policies for safe automation.

What is the difference between codex and codex exec?

codex launches an interactive REPL where you converse with the agent. codex exec runs a single task non-interactively and exits, making it ideal for CI/CD pipelines, cron jobs, and scripted automation where you need one-shot execution.

How does codex resume work and how do I continue the last session?

codex resume reopens a previous interactive session by ID, name, or through an interactive picker, preserving the full conversation history. Recent releases also support /resume <name> inside a running session for direct jumps. To continue your most recent conversation, run codex resume --last, or run codex resume --help to see the flags supported by your installed version.

Which sandbox mode should I use?

Codex has three sandbox modes. Use read-only for analysis tasks (reviewing code, generating reports) where Codex shouldn't touch files, and workspace-write when you want it to create or edit files in the workspace. workspace-write blocks network access by default, so for tasks that call external APIs, either enable sandbox_workspace_write.network_access in config.toml or use danger-full-access, which removes all restrictions — reserve it for trusted operations.

How do I add a GitHub or Jira MCP server?

Run codex mcp add <name> <command> with the appropriate MCP server binary for your tool. Then use codex mcp list to confirm it's registered. MCP servers let Codex file GitHub issues, query Jira boards, or interact with databases without leaving the terminal.

How do I use Codex in a GitHub Actions workflow?

codex exec runs non-interactively, so it takes no approval flag. Set your OPENAI_API_KEY as a GitHub Actions secret and call codex exec --sandbox read-only "Review the diff and summarize risks" (use --sandbox workspace-write if it needs to edit files). Only on a fully isolated runner where you want to drop every restriction should you add --dangerously-bypass-approvals-and-sandbox.

What is Guardian approval in Codex CLI?

Guardian is a subagent that can route sensitive review requests for additional approval before actions are taken. When configured, the guardian inherits sandbox and network settings from its parent session. Combine it with the interactive -a / --ask-for-approval policy (on-request or never) to control how Codex escalates risky operations, keeping Guardian as an extra gate for high-impact edits.

Are these command examples safe to run directly?

Treat them as templates. Replace placeholder prompts with your actual task, and choose --sandbox and approval settings appropriate for your environment. In interactive runs, -a / --ask-for-approval controls when Codex pauses for confirmation; codex exec is non-interactive and never prompts, so in automated pipelines the --sandbox mode is your main safety control.

How up to date is this OpenAI Codex CLI cheat sheet?

This reference documents codex-cli 0.167.1. The version history summarizes selected changes to flags, subcommands, sandbox behavior, and in-session operations. Check codex --version and codex --help to confirm the commands supported by your installed version.