Terminal Tools
Codex CLI Integration Guide
Configure OpenAI Codex CLI with Infercom's EU sovereign inference. Agentic coding assistant with Responses API support and full GDPR compliance.
Codex CLI is OpenAI’s open-source agentic coding assistant that runs in your terminal. It can read files, write code, run commands, and iterate on its work using the Responses API.
Prerequisites
Section titled “Prerequisites”- Node.js 18 or later
- npm or yarn
- Infercom API key
Installation
Section titled “Installation”npm install -g @openai/codexVerify installation:
codex --versionConfiguration
Section titled “Configuration”Codex CLI supports custom providers via a TOML configuration file.
Step 1: Set Environment Variable
Section titled “Step 1: Set Environment Variable”export INFERCOM_API_KEY="your-infercom-api-key"Step 2: Create Config File
Section titled “Step 2: Create Config File”Create ~/.codex/config.toml:
# Define Infercom as a provider[model_providers.infercom]name = "Infercom (EU Sovereign)"base_url = "https://api.infercom.ai/v1"env_key = "INFERCOM_API_KEY"wire_api = "responses"
# Default profile using MiniMax-M2.7model_provider = "infercom"model = "MiniMax-M2.7"Step 3: Verify Setup
Section titled “Step 3: Verify Setup”Run Codex in any project directory:
codexYou should see Codex start with:
model: MiniMax-M2.7provider: infercomUse MiniMax-M2.7 - optimized for agentic coding with 192K context and built-in reasoning.
Interactive Mode
Section titled “Interactive Mode”Start Codex in your project directory:
cd your-projectcodexType your request and Codex will:
- Read relevant files
- Write or edit code
- Run terminal commands
- Iterate until the task is complete
Example Tasks
Section titled “Example Tasks”- “Add error handling to the login function”
- “Write unit tests for the User class”
- “Refactor this file to use async/await”
- “Find and fix the bug causing the test to fail”
Non-Interactive Mode
Section titled “Non-Interactive Mode”For scripted or one-shot use, use the exec subcommand:
codex exec "Add input validation to auth.py"Configuration Options
Section titled “Configuration Options”Full ~/.codex/config.toml reference:
# Default model to usemodel = "MiniMax-M2.7"
# Provider to usemodel_provider = "infercom"
# Approval mode: "suggest" (default), "auto-edit", or "full-auto"approval_mode = "suggest"
# Sandbox mode for command executionsandbox = "docker" # or "none" to disable
[model_providers.infercom]name = "Infercom (EU Sovereign)"base_url = "https://api.infercom.ai/v1"env_key = "INFERCOM_API_KEY"wire_api = "responses"Approval Modes
Section titled “Approval Modes”| Mode | Behavior |
|---|---|
suggest |
Shows diffs and asks before applying (default) |
auto-edit |
Automatically applies file changes, asks for commands |
full-auto |
Automatically applies all changes |
Troubleshooting
Section titled “Troubleshooting”Connection Errors
Section titled “Connection Errors”Verify your configuration:
# Check API key is setecho $INFERCOM_API_KEY
# Test API directlycurl -s https://api.infercom.ai/v1/responses \ -H "Authorization: Bearer $INFERCOM_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"MiniMax-M2.7","input":"Hello"}' | jq .statusExpected output: "completed"
Model Not Found
Section titled “Model Not Found”Ensure the model name is exact (case-sensitive): MiniMax-M2.7
Slow Responses
Section titled “Slow Responses”MiniMax-M2.7 runs at 400+ tokens/sec. If responses seem slow:
- Check your network connection
- Large context (many files) increases processing time
- First request may be slower due to model loading
Why Codex CLI with Infercom?
Section titled “Why Codex CLI with Infercom?”| Feature | Benefit |
|---|---|
| EU Sovereign | Data processed in Germany, GDPR compliant |
| Responses API | Native support for Codex’s agentic architecture |
| Fast inference | 400+ tokens/sec with MiniMax-M2.7 |
| No vendor lock-in | Open-source tool, standard API |
Next Steps
Section titled “Next Steps”- Aider - Alternative terminal-based tool
- OpenCode - Modern TUI with similar features
- Responses API - API documentation for custom integrations