Skip to content

Agentic Coding with OpenAI Codex CLI 10-1-25 Slides and exercises for a training course on OpnenAI's Codex CLI tool

License

Notifications You must be signed in to change notification settings

pythontime/codex-training

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OpenAI Codex CLI Training

A comprehensive training course for mastering OpenAI Codex CLI - the lightweight terminal-based AI coding agent.

Course Overview

This 5-hour hands-on workshop covers everything from basic installation to advanced multi-model configurations, custom MCP servers, and enterprise deployment patterns.

What You'll Learn

  • πŸš€ 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

Prerequisites

  • Command-line experience
  • Basic programming knowledge in at least one language
  • Git familiarity
  • Docker (for advanced exercises)

Repository Structure

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

Quick Start

1. Install Codex

# Via npm (recommended)
npm install -g @openai/codex

# Via Homebrew
brew install codex

# Verify installation
codex --version

2. Authenticate

# ChatGPT account (recommended)
codex login

# Or use API key
export OPENAI_API_KEY="your-key"

3. Run Your First Command

codex "Create a hello world function in Python"

4. Start the Training

# 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:3030

Exercises

Lab 1: Spring Boot REST API

Build 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

Lab 2: Python Code Refactoring

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

Lab 3: React TypeScript Forms

Create a production-ready registration form with:

  • React Hook Form + Zod validation
  • Accessibility compliance
  • Multi-step workflow
  • Full test coverage

Time: 45-60 minutes

Lab 4: Microservices Architecture

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

Key Codex Features Covered

Core Features

  • βœ… Terminal UI navigation
  • βœ… Sandbox modes and approval policies
  • βœ… Project memory with AGENTS.md
  • βœ… Custom prompts and profiles
  • βœ… Session management and resumption

Advanced Features

  • βœ… Model Context Protocol (MCP)
  • βœ… Multi-model provider support (OpenAI, Anthropic, Ollama)
  • βœ… Running as MCP server
  • βœ… CI/CD integration
  • βœ… Headless execution

Configuration

  • βœ… TOML configuration files
  • βœ… Environment variables
  • βœ… Shell environment policies
  • βœ… Notification systems
  • βœ… Logging and debugging

Tips for Success

  1. Start with Read-Only Mode: Get comfortable before making changes
  2. Use AGENTS.md: Provide context for better results
  3. Create Profiles: Separate development/production configurations
  4. Review Generated Code: Never blindly accept AI suggestions
  5. Leverage MCP: Extend capabilities with external tools
  6. Test Thoroughly: Always verify generated code works correctly

Useful Commands Reference

# 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 sessions

Resources

Instructor

Kenneth Kousen

Contributing

Found an issue or want to contribute? Please:

  1. Open an issue on GitHub
  2. Submit a pull request
  3. Share your experience

License

This training material is licensed under the MIT License. See LICENSE file for details.

Acknowledgments

  • 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!

About

Agentic Coding with OpenAI Codex CLI 10-1-25 Slides and exercises for a training course on OpnenAI's Codex CLI tool

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 52.2%
  • TypeScript 11.9%
  • Java 11.5%
  • Shell 9.1%
  • JavaScript 6.2%
  • Go 5.2%
  • Other 3.9%