CDX-101 · Module 1
Essential Commands
4 min read
Codex CLI operates in three approval modes that control how much autonomy the agent has. These are set via flags when launching Codex, or changed mid-session. Understanding the three modes is the most important operational decision you will make.
# Suggest mode (default) — asks permission for everything
codex --suggest "refactor the auth module"
# Auto-edit mode — auto-applies file edits, asks before commands
codex --auto-edit "refactor the auth module"
# Full-auto mode — runs everything without asking
codex --full-auto "refactor the auth module"
Beyond the three approval modes, Codex provides several essential CLI commands and flags for common workflows.
# Execute a one-shot task and print the result
codex exec "explain what this regex does: ^(?=.*[A-Z])(?=.*\d).{8,}quot;
# Resume a previous session
codex resume
# Fork — start a new session branching from a previous one
codex fork
# Delegate a task to a cloud sandbox
codex cloud "set up the test infrastructure for the payments module"
# Pass an image for multimodal input
codex -i screenshot.png "fix the layout issues shown in this screenshot"
Codex also supports a growing set of slash commands within the interactive session. These provide quick access to common operations without leaving the chat interface.
/compact Summarize and compress the current context
/model Switch to a different model mid-session
/plan Enter plan mode for upfront design
/diff Show the current diff of all changes
/review Review recent changes for issues
/status Show session status (model, tokens, mode)
/clear Clear conversation history
/fork Branch into a new session
/copy Copy last response to clipboard
/mention Reference a file for context