OpenAI Codex CLI Integration
Configure and use OpenAI Codex in your command line through AiHubMix
OpenAI Codex CLI Integration
AiHubMix offers seamless integration with OpenAI Codex CLI, enabling you to leverage advanced AI programming assistance directly in your command line environment. With simple configuration steps, you can use natural language to perform various programming and system operations from your terminal.
Configuration Steps
1. Set Environment Variables
Open your shell configuration file (e.g., .zshrc
or .bashrc
) and add the following environment variables:
The OPENAI_API_KEY
should be your AiHubMix key. The variable name remains OPENAI_API_KEY
for compatibility with the OpenAI native client.
2. Apply Configuration Changes
Execute the following command in your terminal to apply the environment variables:
3. Launch Codex CLI
Navigate to your project directory and run the codex
command:
4. Execute Tasks Using Natural Language
Now you can input instructions to Codex CLI using natural language, for example:
Advanced Configuration
- The default model is the cost-effective
o4-mini
, which can be modified in~/.codex/config.json
- Currently only OpenAI models are supported, you can find the model list in the Responses API documentation
- You can customize the system prompt by editing the
~/.codex/instructions.md
file to tailor the AI assistant’s behavior