Installation & Login
System requirements
Other requirements:
- Network access to OpenAI services
- Git (recommended for diff and checkpoints)
- Terminal: Windows Terminal, iTerm2, Kitty, etc.
Install Codex CLI
Method 1: Official install script (recommended)
macOS / Linux:
Windows (PowerShell):
Unattended install:
Method 2: npm
Method 3: Homebrew (macOS)
Verify
Login
The first codex run prompts for authentication. Two options:
1. ChatGPT account (recommended for individuals)
- Requires a plan that includes Codex (Plus / Pro, etc.)
- Configures the API key automatically
- Cloud features and quotas may differ from raw API billing—check official docs
2. OpenAI API key
- Good for CI and pay-as-you-go enterprise use
- Create a key at platform.openai.com
- Some ChatGPT-only features may be unavailable
Directories and environment variables
IDE extension (optional)
- VS Code Marketplace
- Cursor, Windsurf, VS Code Insiders
After install, open the Codex panel in the sidebar and sign in with ChatGPT or an API key. Agent mode can read and write the project by default.
Codex App (optional)
Download macOS / Windows installers from Codex Quickstart, select a project folder, and send your first message in Local mode.
Troubleshooting
codex: command not found
- Confirm the install script added the binary to
PATH - For npm global installs, ensure
npm prefix -gis onPATH
Unexpected Shell behavior on Windows
- Prefer official Windows sandbox docs: Windows setup
- Use WSL2 when you need a Linux-native toolchain
Login failure or 401
- Check system time, proxy, and firewall
- Verify the API key is valid and Codex is enabled for your org
Next steps
- Quick Start: interactive TUI and
codex exec - Config & CLI Reference: persistent sandbox and model defaults