This guide provides practical examples for using codex_yolo effectively.
# Start codex_yolo in your project directory
cd /path/to/your/project
codex_yoloOn first run, you'll be prompted to log in. Follow the authentication flow.
# Standard login (opens browser)
codex_yolo login
# Device authentication (for remote/headless systems)
codex_yolo login --device-auth# Ask Codex to review your current changes
cd your-repo
codex_yolo
# Then: "Review the changes in this branch and suggest improvements"# Let Codex help debug and fix issues
codex_yolo
# Then: "There's a null pointer error in the authentication module. Help me fix it."# Have Codex implement a feature
codex_yolo
# Then: "Add a new REST endpoint for user profile updates with validation"# Generate test cases
codex_yolo
# Then: "Write unit tests for the user authentication service"# Generate or improve documentation
codex_yolo
# Then: "Add JSDoc comments to all functions in src/utils.js"Create ~/.codex_yolo/config to set persistent preferences:
# Example configuration
echo 'CODEX_VERBOSE=1' > ~/.codex_yolo/config
echo 'CODEX_SKIP_UPDATE_CHECK=0' >> ~/.codex_yolo/configGet detailed information about what codex_yolo is doing:
codex_yolo --verbose
# or
CODEX_VERBOSE=1 codex_yolo# Force pull base image and rebuild
codex_yolo --pull
# Force rebuild without cache
CODEX_BUILD_NO_CACHE=1 codex_yolo
# Both together
CODEX_BUILD_NO_CACHE=1 codex_yolo --pullUse this when you need gh workflows that depend on host Copilot state:
codex_yolo --ghPrerequisites:
- Host has
ghinstalled - Host is already authenticated (
gh auth login) - Host
~/.copilotdirectory exists
When enabled, ~/.copilot is mounted and ~/.config/gh is also mounted if it exists on the host.
Preview Docker commands without executing:
CODEX_DRY_RUN=1 codex_yolo# Skip checking for codex_yolo updates
CODEX_SKIP_UPDATE_CHECK=1 codex_yolo
# Skip checking for Codex CLI version updates
CODEX_SKIP_VERSION_CHECK=1 codex_yolo# Run diagnostics to check configuration
codex_yolo diagnostics
# or
codex_yolo doctor# Show codex_yolo version
codex_yolo version
# or
codex_yolo --version# Check Docker status
docker info
# Start Docker (varies by system)
# macOS: Start Docker Desktop
# Linux: sudo systemctl start docker# Check workspace permissions
ls -la
# Ensure .codex directory is writable
chmod 755 ~/.codex# Run diagnostics
codex_yolo diagnostics
# Try rebuilding without cache
CODEX_BUILD_NO_CACHE=1 codex_yolo --pullAlways run codex_yolo from your repository's root directory:
cd /path/to/repo
codex_yoloEnsure your Git identity is configured for proper commit attribution:
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"Codex runs in --yolo mode but always review generated changes:
# After Codex makes changes
git diff
git statusBe specific about what you want Codex to do:
- ✅ "Add input validation to the login form with email and password checks"
- ❌ "Fix the form"
Work in small iterations:
- Ask Codex to make a specific change
- Review the change
- Test the change
- Iterate if needed
# Use in CI with device auth
CODEX_SKIP_UPDATE_CHECK=1 codex_yolo login --device-auth
codex_yolo "Run all tests and fix any failures"# Add to .git/hooks/pre-commit
#!/bin/bash
codex_yolo "Review and format staged changes"#!/bin/bash
# automated-refactor.sh
export CODEX_VERBOSE=1
export CODEX_SKIP_UPDATE_CHECK=1
cd "$PROJECT_DIR"
codex_yolo "Refactor all TypeScript files to use strict mode"Quick reference for all configuration options:
# Core settings
CODEX_BASE_IMAGE=node:20-slim
CODEX_YOLO_IMAGE=codex-cli-yolo:local
CODEX_YOLO_HOME=/home/codex
CODEX_YOLO_WORKDIR=/workspace
# Repository settings
CODEX_YOLO_REPO=laurenceputra/codex_yolo
CODEX_YOLO_BRANCH=main
# Behavior flags
CODEX_YOLO_CLEANUP=1
CODEX_SKIP_UPDATE_CHECK=0
CODEX_SKIP_VERSION_CHECK=0
CODEX_BUILD_NO_CACHE=0
CODEX_BUILD_PULL=0
CODEX_DRY_RUN=0
CODEX_VERBOSE=0The Docker image is cached after first build, making subsequent runs fast.
You can use codex_yolo in multiple projects simultaneously - just run it from different directories.
Once the image is built, you can use codex_yolo offline (though authentication requires internet).
# Use a different Node.js version
CODEX_BASE_IMAGE=node:18-slim codex_yolo- Run
codex_yolo --helpfor Codex CLI help - Run
codex_yolo diagnosticsfor system health check - Visit: https://github.com/laurenceputra/codex_yolo
- Report issues: https://github.com/laurenceputra/codex_yolo/issues