OpenAI Codex is a cloud-native software engineering agent that parallelizes work across Git worktrees. Unlike terminal-based alternatives (Claude Code, Kimi), Codex operates through a command-center interface with real-time web dashboard for monitoring multiple simultaneous agents.
This guide covers installation across all supported platforms and basic configuration to get first tasks running.
Prerequisites
Before installing Codex, you need:
- Git repository — Codex requires a Git-tracked project (worktrees are Git-native)
- ChatGPT account — Plus ($20/mo), Pro ($200/mo), Team, or Enterprise
- Node.js 18+ (for CLI installation) or macOS 12+ (for desktop app)
Important: Codex does not support “bring your own API key.” You must authenticate via ChatGPT account and purchase separate credits for Codex usage.
Installation Options
Option 1: CLI via NPM (Recommended for Developers)
The command-line interface provides maximum flexibility and integrates with existing terminal workflows.
| |
Platforms: macOS (arm64/x86_64), Linux (arm64/x86_64), Windows (via WSL)
Option 2: CLI via Homebrew (macOS/Linux)
For macOS users preferring Homebrew over NPM:
| |
Note: The --cask flag installs the desktop app; without it installs CLI only. Most developers want CLI.
Option 3: GitHub Releases (Binary Download)
For air-gapped environments or specific version pinning:
- Visit github.com/openai/codex/releases
- Download binary for your platform:
codex-macos-arm64(Apple Silicon)codex-macos-x86_64(Intel Mac)codex-linux-arm64(ARM Linux)codex-linux-x86_64(x86 Linux)
- Move to PATH:
chmod +x codex-* && sudo mv codex-* /usr/local/bin/codex
Current stable: v0.94.0 (released February 2, 2026)
Option 4: macOS Desktop App
For users preferring GUI over terminal:
- Download from openai.com/codex
- Drag to Applications folder
- Launch and authenticate with ChatGPT account
- Grant accessibility permissions when prompted
Features:
- Menu bar agent monitoring
- Visual worktree dashboard
- Drag-and-drop task creation
- Native macOS notifications
Limitations: Cannot be used for remote/SSH development; local projects only.
JetBrains IDE Integration
Codex provides native JetBrains plugin support (IntelliJ IDEA, PyCharm, WebStorm, etc.).
Installation
- Open JetBrains IDE → Preferences → Plugins
- Search “OpenAI Codex” in Marketplace
- Click Install → Restart IDE
- Authenticate via Codex tool window (ChatGPT sign-in)
Configuration
Tool Window Setup:
- View → Tool Windows → Codex
- Dock alongside Project/Structure windows
- Pin for persistent access
Keyboard Shortcuts:
- Default:
Cmd+Shift+C(macOS) /Ctrl+Shift+C(Linux/Windows) - Customize: Preferences → Keymap → search “Codex”
Editor Integration:
- Inlay hints show agent status in code margins
- Right-click → “Explain with Codex” for contextual queries
- Right-click → “Refactor with Codex” for multi-file changes
AGENTS.md Configuration
Codex supports declarative agent configuration via AGENTS.md files in your repository root. This transforms generic assistants into organization-specific team members.
Basic Structure
| |
Key Configuration Options
| Field | Description | Values |
|---|---|---|
model | GPT model to use | gpt-5.2-codex, gpt-5.1-codex-mini |
reasoning | Thinking depth | low, medium, high, xhigh |
skills | Available tools | $search, $test, $semgrep, $imagegen, etc. |
scope | File patterns agent can access | Glob patterns relative to repo root |
constraints | Behavioral rules | Custom key-value pairs |
Worktree Configuration
For parallel execution, Codex creates Git worktrees automatically. You can pre-configure worktree structure:
| |
Basic Workflow Example
Step 1: Navigate to Git Repository
| |
Step 2: Initialize Codex Session
| |
Output:
- Task decomposition displayed in terminal
- Dependency analysis
- Proposed worktree allocation
- Estimated credit cost
Step 3: Review and Execute
| |
Step 4: Monitor Progress
Terminal: Real-time streaming output from active agents
Web Dashboard: Open https://codex.openai.com/dashboard (automatically launched on codex execute)
- Visual progress bars per agent
- File change diffs
- Test execution status
- Credit consumption tracking
Step 5: Review and Merge
| |
Authentication and Credits
ChatGPT Account Linking
| |
Credit Management
Critical: Codex requires credit purchases separate from subscription fees.
| |
Credit Consumption (approximate):
- Local task with GPT-5.2-Codex: ~5 credits
- Local task with GPT-5.1-Codex-Mini: ~1 credit
- Cloud task (parallel agents): ~10-50 credits depending on complexity
Rate Limits by Tier:
| Tier | Local Msgs/5h | Cloud Tasks/5h | Credits/Month |
|---|---|---|---|
| Plus ($20) | 45-225 | 10-60 | Purchase separately |
| Pro ($200) | 300-1500 | 50-400 | Purchase separately |
| Enterprise | Unlimited | Unlimited | Custom billing |
Troubleshooting
“Not a Git repository” Error
Cause: Codex requires Git initialization.
Fix:
| |
Authentication Failures
Symptoms: codex auth login hangs or returns error.
Fixes:
- Clear browser cookies for openai.com
- Run
codex auth logout && codex auth login - Check ChatGPT subscription status at chatgpt.com
- Verify no corporate VPN blocking OAuth
Rate Limit Errors
Symptoms: “Rate limit exceeded” during heavy usage.
Solutions:
- Upgrade to Pro tier (6x higher limits)
- Switch to GPT-5.1-Codex-Mini (4x higher rate limits)
- Wait for 5-hour rolling window to reset
- Purchase additional credits (does not increase rate limits)
Worktree Conflicts
Symptoms: “Worktree already exists” or merge conflicts.
Fix:
| |
Credit Depletion Mid-Task
Critical: Tasks halt if credits deplete. There is no “pay later” option.
Prevention:
| |
Advanced Configuration
Custom Skills Development
Extend Codex with organization-specific skills:
| |
Integration with CI/CD
| |
Note: Codex CLI is designed for interactive use. CI integration requires careful handling of authentication and credits.
Security Best Practices
- Repository Scope: Configure tight
scopepatterns in AGENTS.md to limit file access - Review Mode: Use
codex reviewbeforecodex executefor high-risk operations - Test Constraints: Set
test_coverage_minimumand require passing tests before merge - Secret Exclusion: Ensure
.envfiles and secrets directories are in.gitignoreand excluded from scope - Audit Logging: Enterprise tier includes 7-year audit retention; lower tiers have limited logging
See detailed security analysis: /risks/codex/cloud-dependency-risks/
Migration from Other Tools
From Claude Code
Key differences:
- Claude Code: Terminal-native, API billing, transparent reasoning
- Codex: Cloud dashboard, credit system, parallel agents
Migration:
| |
From Kimi k2.5
Key differences:
- Kimi: API keys, local execution, 100 sub-agents
- Codex: ChatGPT auth, cloud execution, Git worktrees
Migration:
- No direct import; manually create AGENTS.md with equivalent scope patterns
- Kimi k2.5 can run alongside Codex on same project (use Git to coordinate)
Next Steps
- Configure AGENTS.md: /agents/agents-md/ — Templates and best practices for agent configuration
- Complete verification: /verify/codex-claims/ — Fact-check before relying on Codex
- Understand risks: /risks/codex/cloud-dependency-risks/ — Cloud dependency and lock-in analysis
- Compare alternatives: /compare/codex-vs-claude-vs-cursor/ — Decision framework
- Read full analysis: /posts/codex-claude-kimi-agent-comparison-2026-02-03/ — 2,700-word technical comparison
Sources & Updates
Last updated: February 3, 2026
Installation sources:
- NPM package: @openai/codex
- GitHub releases: openai/codex
- Homebrew:
brew info codex
Documentation:
- Official docs: platform.openai.com/docs/codex
- JetBrains plugin: JetBrains Marketplace → “OpenAI Codex”
Version verified: v0.94.0 (latest stable)
Invalidation triggers:
- New CLI releases with breaking changes
- Authentication method changes
- Pricing/credit system modifications