Syntax
Description
Thecodex command launches the interactive Codex TUI (Terminal User Interface). If you provide a prompt as an argument, Codex starts with that prompt pre-filled. Without arguments, you’ll see an empty prompt where you can type your request.
Usage
Interactive Mode
Start Codex with an empty prompt:With Initial Prompt
Start Codex with a specific task:With Images
Attach images to your prompt:Options
Initial prompt to send to Codex. If not provided, starts with empty prompt.
Model & Provider
AI model to use (e.g.,
gpt-4.1, o4-mini). Defaults to configured model.Use open-source/local model provider instead of OpenAI.
Specify OSS provider:
ollama, lmstudio. Only valid with --oss.Approval & Sandbox
Run in full-auto mode with workspace-write sandbox. No approvals required for file writes or shell commands.
Sandbox mode:
workspace-write, workspace-read-network-write, read-only, danger-full-access.Approval policy:
never, on-request, for-risky-ops.Skip all approval checks and sandbox restrictions. Use with extreme caution.
Input
Comma-separated list of image paths to attach. Supports PNG, JPEG, GIF, WebP.
Additional directories to make writable in sandbox (repeatable).
Enable web search for this session.
Session Management
Working directory for this session.
Don’t save this session to history.
Skip the check for being inside a Git repository.
Configuration
Use a specific config profile.
Override config.toml setting (repeatable). Format:
key=value or section.key=value.Examples:-c model=gpt-4.1-c permissions.approval_policy=never
Enable a feature flag (repeatable). Equivalent to
-c features.<name>=true.Disable a feature flag (repeatable). Equivalent to
-c features.<name>=false.Examples
Basic Usage
Full Auto Mode
With Images
Local/OSS Models
Configuration Overrides
Special Directories
Terminal Requirements
Codex’s interactive TUI requires a terminal that supports:- ANSI escape codes
- UTF-8 encoding
- Terminal dimensions (rows/columns)
TERM=dumb, Codex will warn you and ask for confirmation before starting.
Related Commands
codex exec- Non-interactive execution for automationcodex resume- Continue a previous sessioncodex fork- Fork a previous session