This guide is the fastest way to get from a fresh clone to a working local session.
This repository produces two closely related entrypoints:
xliis the packaged distribution used by this fork.codexis the upstream/source-build binary name used insidecodex-rs/.
Choose the path that matches how you want to run the tool:
- Build from source: follow install.md.
- Use the packaged launcher: install the
xlidistribution and use the same config format documented in this directory.
If you build from source in this repo, the binary lands at
codex-rs/target/release/codex.
The runtime reads config and local state from the active Codex home directory:
- XLI default:
~/.xli - Upstream/default engine path:
~/.codex - Override: set
CODEX_HOME; the XLI launcher also honorsXLI_HOME
In practice, the main file you will care about is:
$CODEX_HOME/config.toml
The quickest path is to copy one of the shipped examples from
../examples/:
mkdir -p ~/.xli
cp examples/anthropic.toml ~/.xli/config.tomlFor multi-provider setups or more detailed examples, read
example-config.md and ../examples/README.md.
There are two common patterns:
- OpenAI / ChatGPT managed auth: use
xli loginorcodex login - Provider-native auth (Anthropic, Gemini, custom endpoints): export the
env vars referenced by
env_http_headersin your config
Example:
export ANTHROPIC_API_KEY="your-key"See authentication.md for the full breakdown.
xlior, from a source build:
cargo run --manifest-path codex-rs/Cargo.toml --bin codexxli -p sonnet
xli -p gemini-proxli exec "Explain the provider abstraction in codex-api/"The most important first-run commands are:
| Command | What it does |
|---|---|
xli |
Launch the interactive TUI |
xli -p <profile> |
Switch model/provider bundles defined in config.toml |
xli exec <prompt> |
Run a non-interactive task |
xli login |
Start managed OpenAI/ChatGPT auth |
xli logout |
Remove managed auth state |
xli sandbox <cmd> |
Run a command inside the host sandbox |
xli resume --last |
Resume the most recent saved session |
Inside the TUI, type / to open the slash-command picker. Start with
/model, /permissions, /status, /review, and /compact.
The agent's runtime behavior is shaped by two separate controls:
- Sandbox mode determines where commands may run and what they may access.
- Approval policy determines when the user must approve actions.
Read sandbox.md before using danger-full-access or broad write
permissions.
- config.md for layered config, profiles, hooks, and MCP
- skills.md for reusable task guidance
- slash_commands.md for TUI controls
- agents_md.md for repository-scoped instructions
- architecture/turn-lifecycle-xli.md for runtime internals