OpenEx is a public, local-first fork of OpenAI's Codex CLI. It keeps the upstream Codex CLI feature set while renaming the user-facing command to openex and adding first-class support for OpenAI-compatible API-key providers.
OpenEx is not an official OpenAI distribution. Internal Rust crate names, protocol IDs, telemetry names, and some upstream model identifiers still use codex where changing them would break inherited compatibility.
- Runs from the terminal as
openex. - Uses
~/.openex/OPENEX_HOMEfor user config by default. - Supports the original Codex CLI workflows, including interactive chat,
exec, MCP, plugins, completions, resume, debug commands, and model selection. - Adds a built-in
openai-compatibleprovider that can point at any provider exposing an OpenAI-compatible/v1/responsesAPI. - Keeps a built-in
nvidiaprovider for NVIDIA NIM as a preset. - Refreshes
/modelsfrom the active API-key provider's/v1/modelsendpoint when the provider supports model listing.
Use environment variables for provider credentials:
export OPENEX_API_KEY="<provider-api-key>"
export OPENEX_BASE_URL="https://provider.example.com/v1"
export OPENEX_MODEL="provider/model-id"
openexThe generic provider is:
model_provider = "openai-compatible"
model = "provider/model-id"
model_reasoning_summary = "none"OPENEX_BASE_URL defaults to https://api.openai.com/v1 when omitted. OPENEX_MODEL defaults to gpt-5 only for the local launcher when an API key is present and no model is supplied.
export OPENEX_API_KEY="<your-nvidia-api-key>"
export OPENEX_BASE_URL="https://integrate.api.nvidia.com/v1"
export OPENEX_MODEL="nvidia/nemotron-3-ultra-550b-a55b"
openexThe NVIDIA preset is still available if you prefer the provider-specific variable:
export NVIDIA_API_KEY="<your-nvidia-api-key>"
openex -c model_provider=nvidia -c model=nvidia/nemotron-3-ultra-550b-a55bDo not commit API keys. Keep keys in your shell environment, a private env file, or your secret manager.
You can also define named providers in ~/.openex/config.toml:
model_provider = "my-provider"
model = "provider/model-id"
model_reasoning_summary = "none"
[model_providers.my-provider]
name = "My Provider"
base_url = "https://provider.example.com/v1"
env_key = "MY_PROVIDER_API_KEY"
wire_api = "responses"Then run:
export MY_PROVIDER_API_KEY="<provider-api-key>"
openexOpenEx speaks the Responses API. Providers that only expose Chat Completions need a dedicated adapter before they can be used reliably.
cd codex-rs
OPENSSL_DIR=/usr \
OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu \
OPENSSL_INCLUDE_DIR=/usr/include \
cargo build -p codex-cli --bin openexFor this local checkout, ~/.local/bin/openex launches:
/home/coldplay/temp2/codex/codex-rs/target/debug/openex
Use /models in the TUI or openex debug models from the terminal to inspect models from the active provider. OpenEx accepts both the inherited internal model catalog shape and standard OpenAI-compatible responses such as:
{
"data": [
{ "id": "provider/model-id" }
]
}Provider model caches are keyed by provider name and base URL so switching providers does not reuse another provider's fresh model cache.
This repository remains licensed under the Apache-2.0 License.