Codex CLI Setup
Codex CLI is OpenAI’s command-line AI coding tool. Since OfoxAI is fully compatible with the OpenAI protocol, you can integrate seamlessly.
Setup Steps
1. Install Codex CLI
npm install -g @openai/codex2. Set Environment Variables
Codex CLI uses the OpenAI protocol — just configure the environment variables:
~/.zshrc
export OPENAI_API_KEY=<your OFOXAI_API_KEY>
export OPENAI_BASE_URL=https://api.ofox.ai/v1Then reload:
source ~/.zshrc3. Verify Configuration
codex "Create a Hello World Python script"Tips
Specify a Model
Use environment variables or command-line arguments to specify the model:
# Use Codex default model
codex --model openai/gpt-5.2-codex "Refactor this function"
# Use Codex Max (complex tasks)
codex --model openai/gpt-5.1-codex-max "Fix this bug"Recommended Models
| Scenario | Model |
|---|---|
| Code generation | openai/gpt-5.2-codex |
| Complex refactoring | openai/gpt-5.1-codex-max |
Codex CLI configuration options may change with version updates. See the Codex CLI official documentation for the latest information.
Last updated on