GPT WORLD / INDEPENDENT CODEX FIELD MANUAL Source review · 2026-07-31

FIELD GUIDE / CODEX CLI 0.147.0

Operate Codex from prompt to proof.

Eight practical modules connect the complete command inventory to real terminal workflows. Commands come from the shared release manifest; safety boundaries stay explicit.

Open the exhaustive reference
-p = profile

codex exec = headless

JSONL → schema → evidence
01

FIELD PROCEDURE / 01

Interactive sessions and the root command

Start in the intended repository, choose a model or profile, and inspect the active state before work begins. In Codex, -p selects a profile; it never means print or non-interactive mode.

CODEX CLI / VERIFIED PATH
  1. $cd your-repository
  2. $codex --profile deep-review
  3. /status
  4. /permissions
02

FIELD PROCEDURE / 02

Headless execution, JSONL, and schemas

Use codex exec for scripts and CI. --json emits newline-delimited event objects to stdout; --output-schema constrains the final response; --output-last-message saves the final assistant text separately.

CODEX CLI / VERIFIED PATH
  1. $codex exec "Run the affected tests"
  2. $codex exec --json --output-schema schema.json --output-last-message final.txt "Audit the change"
03

FIELD PROCEDURE / 03

Configuration layers, profiles, and overrides

Put durable defaults in config.toml, select $CODEX_HOME/NAME.config.toml with --profile, and reserve -c key=value for a single invocation. Admin requirements constrain what users may override.

CODEX CLI / VERIFIED PATH
  1. $codex --profile deep-review
  2. $codex -c model_reasoning_effort=high
  3. $codex --strict-config
04

FIELD PROCEDURE / 04

Approvals, sandboxing, and permissions

Select filesystem and approval boundaries before granting autonomy. workspace-write plus on-request is a practical starting point; danger-full-access and bypass flags require an external containment boundary.

CODEX CLI / VERIFIED PATH
  1. $codex --sandbox workspace-write --ask-for-approval on-request
  2. $codex sandbox --permission-profile NAME -- command
  3. /permissions
05

FIELD PROCEDURE / 05

Resume, fork, archive, and delete

Resume continues a transcript, fork branches it, archive is reversible, and delete is permanent. Use --last for the newest matching session or a precise session ID when automation must be deterministic.

CODEX CLI / VERIFIED PATH
  1. $codex resume --last
  2. $codex fork --last
  3. $codex archive SESSION_ID
  4. $codex unarchive SESSION_ID
  5. $codex delete SESSION_ID
06

FIELD PROCEDURE / 06

MCP servers and authentication

Register stdio servers after -- or streamable HTTP servers with --url. Keep bearer token values outside config by naming an environment variable, and use MCP login only for servers that support OAuth.

CODEX CLI / VERIFIED PATH
  1. $codex mcp add docs --url https://developers.openai.com/mcp
  2. $codex mcp add local -- node server.mjs
  3. $codex mcp get docs --json
  4. $codex mcp login docs --scopes tools.read
07

FIELD PROCEDURE / 07

Plugins, skills, and hooks

Marketplaces provide plugin catalogs; plugins may add tools, MCP servers, skills, and hooks. Inspect the source and trust state before enabling lifecycle hooks or running skill scripts.

CODEX CLI / VERIFIED PATH
  1. $codex plugin marketplace list
  2. $codex plugin list --available --json
  3. $codex plugin add PLUGIN@MARKETPLACE
  4. /plugins
  5. /skills
  6. /hooks
08

FIELD PROCEDURE / 08

Review, diagnostics, and evidence

Finish with the affected tests, inspect the diff, run a focused review, and use doctor when installation, auth, config, Git, or runtime state is unclear.

CODEX CLI / VERIFIED PATH
  1. /diff
  2. /review
  3. $codex review --uncommitted
  4. $codex doctor --summary
  5. $git status --short

SHARED MANIFEST / SUPPORTED WORKFLOWS

The guide resolves back to the inventory.

Examples target installed Codex CLI 0.147.0. Hidden execpolicy surfaces are inventory-only and are not part of these supported workflows.

  • codexruntime-confirmed
  • codex execruntime-confirmed
  • codex sandboxruntime-confirmed
  • codex resumeruntime-confirmed
  • codex archiveruntime-confirmed
  • codex deleteruntime-confirmed
  • codex forkruntime-confirmed
  • codex mcp getruntime-confirmed
  • codex mcp addruntime-confirmed
  • codex mcp loginruntime-confirmed
  • codex plugin listruntime-confirmed
  • codex plugin marketplaceruntime-confirmed

NEXT / SEARCH EVERY SURFACE

Open the exhaustive reference

70 command paths · 515 options · 390 keys