Building the Rust Implementation
The Rust implementation is the maintained version of Codex CLI and lives incodex-rs/.
Quick Start
Build-Related Commands
After making changes, use these workspace helpers:Workspace Organization
Thecodex-rs/ directory is a Cargo workspace with these key crates:
| Crate | Purpose |
|---|---|
core/ | Business logic for Codex - intended as a reusable library crate |
tui/ | Fullscreen TUI built with Ratatui |
exec/ | Headless CLI for automation and non-interactive use |
cli/ | CLI multitool providing TUI and exec via subcommands |
app-server/ | App server protocol implementation |
app-server-protocol/ | Protocol types and schemas |
For detailed information about each crate, read the module-level
README.md files under each crate directory.Building the TypeScript Implementation
The legacy TypeScript CLI lives incodex-cli/.
TypeScript Build Commands
Debugging
Debugging the Rust CLI
RUST_LOG environment variable details
RUST_LOG environment variable details
The TUI defaults to
RUST_LOG=codex_core=info,codex_tui=info,codex_rmcp_client=info.Non-interactive mode (codex exec) defaults to RUST_LOG=error with messages printed inline.See the Rust documentation on RUST_LOG for more configuration options.Debugging the TypeScript CLI
Enable Debug Output
For the TypeScript CLI, enable full API request and response logging:Troubleshooting
Build fails with missing dependencies
Build fails with missing dependencies
Ensure all required tools are installed:
Tests fail after building
Tests fail after building
Make sure you’re running tests from the correct directory:
- Rust: Run from
codex-rs/ - TypeScript: Run from
codex-cli/
Format or lint errors
Format or lint errors
Run the automatic fixers:
Next Steps
Testing
Learn about testing workflows
Guidelines
Review coding standards