Codex CLI cheatsheet
Every command below was checked against the installed codex-cli 0.147.0 binary or the official OpenAI Docs on 2026-08-18. “First-hand” means it appeared in codex --help or subcommand help; “docs” means the official documentation is the source of truth for that behavior.
Command drill
16 verified Codex CLI commands. Read the task, type the command, press Enter. Every answer is on this page's tables - this drill only asks what the verified data already states.
Answer key - all 16 commands
- Print the installed CLI version.
codex --version - Update Codex to the latest version.
codex update - Authenticate with ChatGPT OAuth, device auth, an API key, or an access token from stdin.
codex login - Remove stored authentication credentials.
codex logout - Generate a diagnostic report for installation, config, auth, runtime, Git, and session issues.
codex doctor - Start an interactive terminal session in the current directory.
codex - Choose or change the model and reasoning effort in the TUI.
/model - Show current session configuration.
/status - Review changes and find issues from inside a session.
/review - Open the permissions picker and change the active permissions profile.
/permissions - Allow read-only inspection; edits and commands requiring approval remain blocked unless approved.
codex -s read-only - Use the common local-work preset: workspace writes plus approval when Codex needs escalation.
codex -s workspace-write -a on-request - Ask before commands outside the trusted command set.
codex -a untrusted - Never ask for approval; command failures return to the model.
codex -a never - Route eligible approval requests through automatic review with workspace-write sandboxing.
codex --approve-for-me - Skip confirmation prompts and sandboxing.
codex --dangerously-bypass-approvals-and-sandbox