OpenAI Codex CLI is a lightweight coding agent that runs locally, providing multimodal inputs, rich approvals workflow, and terminal-based AI-assisted development
Development utilities provide additional tools for shell completion generation, debugging, and diff application.
Generate shell completion scripts for the Codex CLI.
codex completion <SHELL><SHELL> # Shell to generate completions for (bash, zsh, fish, powershell)# Generate bash completions
codex completion bash > /etc/bash_completion.d/codex
# Generate zsh completions
codex completion zsh > ~/.zsh/completions/_codex
# Generate fish completions
codex completion fish > ~/.config/fish/completions/codex.fish
# Generate PowerShell completions (Windows)
codex completion powershell > codex_completion.ps1# System-wide installation
sudo codex completion bash > /etc/bash_completion.d/codex
# User installation
codex completion bash > ~/.local/share/bash-completion/completions/codex
# Source directly in .bashrc
echo 'eval "$(codex completion bash)"' >> ~/.bashrc# Add to fpath and generate completion
mkdir -p ~/.zsh/completions
codex completion zsh > ~/.zsh/completions/_codex
# Add to .zshrc if not already in fpath
echo 'fpath=(~/.zsh/completions $fpath)' >> ~/.zshrc
echo 'autoload -U compinit && compinit' >> ~/.zshrcInternal debugging commands for sandboxed execution.
codex debug <SUBCOMMAND>Run a command under macOS Seatbelt sandbox.
codex debug seatbelt [OPTIONS] -- <COMMAND>...--full-auto # Enable full automation mode
-- <COMMAND>... # Command to execute under sandboxRun a command under Linux Landlock+seccomp sandbox.
codex debug landlock [OPTIONS] -- <COMMAND>...--full-auto # Enable full automation mode
-- <COMMAND>... # Command to execute under sandbox# Run command under macOS Seatbelt (macOS only)
codex debug seatbelt -- ls -la /tmp
# Run command under Linux Landlock (Linux only)
codex debug landlock -- python script.py
# Run with full automation
codex debug seatbelt --full-auto -- npm install
# Test sandbox restrictions
codex debug landlock -- curl https://example.com # Should fail due to network restrictionsApply the latest diff produced by Codex as a git patch to your local working tree.
codex apply [OPTIONS]Inherits configuration options from global configuration system.
# Apply the latest diff from Codex
codex apply
# Apply with specific configuration
codex apply -c diff_format=unified
# Apply in specific directory
codex -C /path/to/project applycodex apply to apply as git patch# Example workflow
codex exec "Fix the bug in src/main.py"
# Review the suggested changes
codex apply # Apply the changes to working tree
git add .
git commit -m "Fix bug in main.py"Generate TypeScript protocol bindings (hidden command for internal use).
codex generate-ts [OPTIONS]-o, --out <DIR> # Output directory for TypeScript files
-p, --prettier <PATH> # Optional Prettier executable pathThis command is used internally for generating TypeScript bindings and is not part of the public API.
All development utilities support configuration overrides:
# Use specific config profile
codex --config-profile development completion bash
# Override configuration for debugging
codex -c sandbox_mode=strict debug landlock -- command
# Apply with configuration
codex -c git_apply_options="--check" apply# Verify completion file exists and is sourced
which codex
codex completion bash > test_completion.sh
source test_completion.sh# Check platform compatibility
uname -s # Should be Darwin for Seatbelt, Linux for Landlock
# Verify command syntax
codex debug landlock -- echo "test" # Simple test command# Ensure git repository
git status
# Check for uncommitted changes
git diff --check
# Verify Codex generated a diff
codex exec "List files" | grep -i "diff\|patch"Install with Tessl CLI
npx tessl i tessl/npm-openai--codex