A comprehensive training course for mastering OpenAI Codex CLI - the lightweight terminal-based AI coding agent.
This 5-hour hands-on workshop covers everything from basic installation to advanced multi-model configurations, custom MCP servers, and enterprise deployment patterns.
- π Installation & Setup: Multiple authentication methods, configuration strategies
- π‘οΈ Safety & Security: Sandbox modes, approval policies, secure configurations
- π― Core Features: Project memory (AGENTS.md), custom prompts, profiles
- π§ Advanced Capabilities: MCP integration, multi-model support, CI/CD workflows
- π» Practical Skills: Real-world exercises in Java, Python, and TypeScript
- Command-line experience
- Basic programming knowledge in at least one language
- Git familiarity
- Docker (for advanced exercises)
codex-training/
βββ slides.md # Slidev presentation
βββ exercises/ # Hands-on labs
β βββ java-spring-boot/ # Spring Boot REST API
β βββ python-refactoring/ # Legacy code refactoring
β βββ react-forms/ # React TypeScript forms
β βββ microservices/ # Multi-language microservices
βββ config-examples/ # Sample configurations
β βββ basic-config.toml # Minimal setup
β βββ advanced-config.toml # Full features
β βββ mcp-servers.toml # MCP configurations
βββ scripts/ # Utility scripts
βββ setup.sh # Environment setup
βββ verify-install.sh # Installation check
# Via npm (recommended)
npm install -g @openai/codex
# Via Homebrew
brew install codex
# Verify installation
codex --version# ChatGPT account (recommended)
codex login
# Or use API key
export OPENAI_API_KEY="your-key"codex "Create a hello world function in Python"# Clone this repository
git clone https://github.com/kousen/codex-training
cd codex-training
# Install dependencies for slides
npm install
# Start the presentation
npm run dev
# Open browser to http://localhost:3030Build a complete task management API with Spring Boot, including:
- CRUD operations with validation
- H2 database integration
- OpenAPI documentation
- Comprehensive test suite
Time: 60-90 minutes
Transform legacy Python code using modern best practices:
- Add type hints and documentation
- Implement design patterns
- Create pytest test suite
- Setup code quality tools
Time: 45-60 minutes
Create a production-ready registration form with:
- React Hook Form + Zod validation
- Accessibility compliance
- Multi-step workflow
- Full test coverage
Time: 45-60 minutes
Build an event-driven microservices system with:
- Multiple languages (Node.js, Python, Go, Java)
- RabbitMQ message queue
- Docker orchestration
- API gateway
Time: 90-120 minutes
- β Terminal UI navigation
- β Sandbox modes and approval policies
- β Project memory with AGENTS.md
- β Custom prompts and profiles
- β Session management and resumption
- β Model Context Protocol (MCP)
- β Multi-model provider support (OpenAI, Anthropic, Ollama)
- β Running as MCP server
- β CI/CD integration
- β Headless execution
- β TOML configuration files
- β Environment variables
- β Shell environment policies
- β Notification systems
- β Logging and debugging
- Start with Read-Only Mode: Get comfortable before making changes
- Use AGENTS.md: Provide context for better results
- Create Profiles: Separate development/production configurations
- Review Generated Code: Never blindly accept AI suggestions
- Leverage MCP: Extend capabilities with external tools
- Test Thoroughly: Always verify generated code works correctly
# Basic usage
codex # Interactive mode
codex -n "prompt" # Non-interactive
codex --resume # Resume last session
codex --search "text" # Search codebase
# Configuration
codex --profile dev # Use specific profile
codex --sandbox-mode auto # Set sandbox mode
codex --approval-policy never # Set approval policy
# Advanced
codex serve # Run as MCP server
codex doctor # Diagnose issues
codex login --headless # Headless authentication
codex --list-sessions # Show all sessionsKenneth Kousen
- President, Kousen IT, Inc.
- Author & Technical Trainer
- [email protected]
- https://www.kousenit.com
Found an issue or want to contribute? Please:
- Open an issue on GitHub
- Submit a pull request
- Share your experience
This training material is licensed under the MIT License. See LICENSE file for details.
- OpenAI for Codex CLI
- Anthropic for inspiration from Claude Code
- The open-source community for MCP tools
Ready to start? Navigate to the exercises directory and begin with Lab 1!