| name | codex-orange-book-guide |
| description | Expert guide for using OpenAI Codex across all five forms (CLI, Desktop, Cloud, IDE, Chrome) based on the complete Orange Book tutorial |
| triggers | ["how do I use OpenAI Codex effectively","show me Codex CLI commands and workflow","what are the differences between Codex forms","help me set up Codex for my project","explain Codex auto-review and sandbox mode","how to use Codex Desktop App with Computer Use","what are Codex Skills and MCP servers","compare Codex vs Claude Code for my project"] |
OpenAI Codex Orange Book Guide
Skill by ara.so — Codex Skills collection.
Expert knowledge from "OpenAI Codex: The Complete Guide" (橙皮书) by HuaShu — covering all five forms of Codex (CLI, Desktop App, Cloud, IDE Extension, Chrome Extension) plus mobile companion. This skill teaches practical workflows, commands, and patterns for shipping products with AI coding agents.
Overview
The Codex Orange Book is a comprehensive guide covering:
- Five Forms: CLI (Terminal), Desktop App, Cloud, IDE Extensions, Chrome Extension
- Mobile Companion: Remote control for Desktop App (shipped May 14, 2026)
- GPT-5.5: Default model with 82.6% SWE-bench Verified, 82.7% Terminal-Bench 2.0
- Three Pro Tiers: $20 Pro, $100 Pro (recommended for indie devs), $200 Pro
- Key Features: Auto-review, persistent
/goal, Computer Use, Automations, Memory
Installation & Setup
CLI Installation (Primary Interface)
npm install -g @openai/codex-cli
brew install openai-codex
codex --version
codex auth login
cd your-project
codex init
Desktop App Installation
Download from codex.openai.com or install via CLI:
codex install desktop
Chrome Extension
Install from Chrome Web Store or via CLI:
codex install chrome
Core CLI Commands
Project Management
codex init
codex chat
codex chat "Build a REST API with Express"
codex /clear
codex /reset
Essential Commands (In-Session)
/goal Build a real-time chat app with WebSockets
/goal
/goal clear
/sh npm install express
/sh git status
/vim src/index.js
/read package.json
/write src/config.js
/approve
/reject
/auto-review all
/auto-review off
/mode
Sandbox & Safety
codex --sandbox
codex --watch
codex --restrict src/,tests/
codex --dry-run "refactor auth module"
Auto-Review System
Codex v2.0 introduced auto-review that approves ~99% of low-risk actions automatically:
/auto-review interactive
/auto-review all
/auto-review off
/status
/diff src/index.js
Safety Note: Never use /auto-review all with Full Access mode on Windows — documented cases of 370GB+ file deletions.
Desktop App Features
Computer Use
The Desktop App can control your computer beyond the terminal:
"""
Open Chrome, navigate to github.com/new,
create a repository named 'my-project',
initialize with README, and copy the clone URL
"""
Multi-Day Automations
/automation create "Daily backup"
schedule: "0 2 * * *"
tasks:
- /sh npm run backup
- /sh git add .
- /sh git commit -m "Auto backup"
- /sh git push
/automation list
/automation pause "Daily backup"
Mobile Companion
codex remote-control enable
codex remote-control qr
codex remote-control disable
AGENTS.md Configuration
Create AGENTS.md in your project root to guide Codex behavior:
# Project: MyApp
# Stack: Next.js 14, TypeScript, Tailwind, Supabase
## Architecture
- `/app` - Next.js App Router pages
- `/components` - React components (use 'use client' for interactive)
- `/lib` - Utilities and API clients
- `/supabase` - Database schema and migrations
## Coding Standards
- Use TypeScript strict mode
- Follow Airbnb style guide
- Prefer functional components with hooks
- Use Zod for validation
- Write tests with Vitest
## Never
- Don't commit .env files
- Don't use `any` type
- Don't install packages without asking
- Don't modify database/schema.sql directly (use migrations)
## Dependencies
- Authentication: Supabase Auth
- Styling: Tailwind + shadcn/ui
- State: Zustand for global, useState for local
- Forms: React Hook Form + Zod
## Testing
Run tests before committing:
```bash
npm test
npm run typecheck
npm run lint
Deployment
Deploy via Vercel:
npm run build
vercel deploy --prod
## Skills & MCP Servers
### Installing Skills
```bash
# Install skill from file
codex skill install ./path/to/SKILL.md
# Install from URL
codex skill install https://example.com/skills/nextjs-expert.md
# List installed skills
codex skill list
# Enable/disable skills
codex skill enable nextjs-expert
codex skill disable nextjs-expert
# Remove skill
codex skill remove nextjs-expert
Using MCP (Model Context Protocol) Servers
cat > ~/.config/codex/mcp.json << 'EOF'
{
"servers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
}
},
"postgres": {
"command": "docker",
"args": ["run", "-i", "--rm", "mcp/postgres"],
"env": {
"POSTGRES_CONNECTION_STRING": "${DATABASE_URL}"
}
}
}
}
EOF
codex chat "Use github MCP to create an issue"
/mcp list
IDE Extensions
VS Code Extension
code --install-extension openai.codex
codex install vscode
Cursor Integration
Codex can work alongside Cursor:
codex chat "Set up the project structure"
Cloud & Chrome Extension
Cloud Sessions
codex cloud connect
codex cloud sync
codex cloud run "npm run build && deploy to staging"
Chrome Extension Usage
"""
Codex Chrome Extension can:
1. Extract structured data from current page
2. Fill forms automatically
3. Navigate multi-step workflows
4. Capture screenshots with annotations
"""
Real-World Examples
Example 1: Building an Express API
codex chat
/goal Build a REST API with Express, TypeScript, and Prisma. Include auth with JWT.
/status
/approve
/sh npm run dev
Example 2: Adding a Feature with Computer Use (Desktop App)
In Desktop App chat:
"I need to add OAuth login to my Next.js app.
Open the Supabase dashboard in my browser,
create a new OAuth app for Google,
copy the client ID and secret,
update my .env.local file,
and implement the login button component."
(Desktop App will control browser, copy credentials, edit files)
Example 3: Multi-Day Project with Automations
/automation create "Nightly build and test"
schedule: "0 0 * * *"
tasks:
- /sh git pull origin main
- /sh npm install
- /sh npm run build
- /sh npm test
- /sh npm run e2e
- notify: "Build status: ${STATUS}"
/goal Complete the payment integration module with Stripe.
Include webhook handling, subscription management, and invoice generation.
/exit
Example 4: Using Skills with AGENTS.md
codex skill install https://skills.ara.so/nextjs-14-app-router.md
cat > AGENTS.md << 'EOF'
EOF
codex chat "Add a new blog post page with MDX support"
Pricing Tiers (As of May 2026)
| Tier | Price | Best For | Limits |
|---|
| Free | $0 | Testing | 25 messages/day, GPT-4o |
| Pro | $20/mo | Casual users | 500 msgs/day, GPT-5.5 |
| Pro Plus | $100/mo | Indie devs | 5K msgs/day, priority, Cloud |
| Pro Max | $200/mo | Teams | Unlimited, MultiAgentV2, Automations |
Recommendation: $100 Pro Plus is the sweet spot for indie developers shipping products.
Persistent /goal System
Key feature in v2.0 — goals survive across sessions:
/goal Build a SaaS product for invoice management.
Include multi-tenant architecture, PDF generation,
email reminders, and Stripe integration.
codex chat "Start with database schema and auth"
/exit
codex chat "Continue from where we left off"
codex chat "Add PDF generation with Puppeteer"
/clear
codex chat "What's my current goal?"
/goal clear
Troubleshooting
Common Issues
/clear
codex chat "Continue with the same goal"
echo "## Never use class components, only functional" >> AGENTS.md
/auto-review interactive
codex remote-control disable
codex remote-control enable
codex remote-control qr
echo $GITHUB_TOKEN
codex mcp debug github
/model
/model gpt-5.5
Windows Full Access Warning
CRITICAL: Do NOT enable Full Access mode on Windows. Documented cases:
- User lost 370GB of files
- User lost 700GB of files
- User lost 240GB of system files
Use --restrict flag instead:
codex --restrict C:\Users\YourName\Projects\
Debugging Failed Automations
codex automation logs "Daily backup"
codex automation run "Daily backup" --dry-run
codex automation edit "Daily backup"
When to Use Codex vs. Claude Code
From §10 of the Orange Book:
Use Codex when:
- Building new projects from scratch (better project setup)
- Need Computer Use (browser automation, UI testing)
- Running long multi-day workflows (persistent /goal)
- Need cloud execution (no local resources)
- Want mobile remote control
Use Claude Code when:
- Refactoring existing complex code (Opus 4.7: 64.3% SWE-bench)
- Need highest reasoning quality (Opus 4.7 > GPT-5.5)
- Working in mature codebases (better at understanding existing patterns)
- Prefer Cursor-like inline editing
Dual-tool workflow:
codex chat "Set up a React Native app with Expo, TypeScript, and navigation"
Advanced Patterns
Hooks for Custom Workflows
Create .codex/hooks/pre-approve.sh:
#!/bin/bash
echo "Running linter..."
npm run lint
if [ $? -ne 0 ]; then
echo "❌ Lint errors found. Fix before approving."
exit 1
fi
echo "✅ Lint passed"
exit 0
Make executable:
chmod +x .codex/hooks/pre-approve.sh
Multi-Agent Workflows (Pro Max)
/multi-agent enable
/agent create frontend --skills nextjs-14,tailwind
/agent create backend --skills express,prisma
/agent create testing --skills vitest,playwright
codex chat "Frontend agent: build the UI.
Backend agent: create the API.
Testing agent: write e2e tests.
Work in parallel."
Version Control Integration
cat > .codex/hooks/post-approve.sh << 'EOF'
git add .
git commit -m "Codex: $(codex last-message --summary)"
EOF
chmod +x .codex/hooks/post-approve.sh
Resources
Environment Variables
export OPENAI_API_KEY=your_key_here
export CODEX_MODEL=gpt-5.5
export CODEX_AUTO_REVIEW=interactive
export CODEX_RESTRICT=src/,tests/
export GITHUB_TOKEN=ghp_xxxxx
export DATABASE_URL=postgresql://...
Tips from the Orange Book
- Start with
/goal: Set persistent goals for multi-session projects
- Use
AGENTS.md: Guide Codex with project-specific rules upfront
- Install skills: Don't reinvent patterns, use community skills
- Desktop for automation: Computer Use + Automations = powerful workflows
- Mobile for monitoring: Remote control lets you check progress anywhere
- Sandbox for experiments: Use
--sandbox when trying risky changes
- Hook into your toolchain: Pre/post approve hooks integrate with CI/CD
- $100 tier is sweet spot: Pro Plus gives Cloud + enough capacity for indie shipping
- Dual-tool when needed: Codex for scaffolding, Claude Code for complex refactors
- Read the Orange Book: 200+ pages of real-world patterns and gotchas
This skill is based on "OpenAI Codex: The Complete Guide" v2.0.1 by HuaShu (花叔), part of the Orange Book Series. Licensed CC BY-NC-SA 4.0.