> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jiekou.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenAI Codex CLI

## Codex CLI

Codex CLI is a programming terminal agent launched by OpenAI that can run locally on your computer.

1. Install

Run the following command in your terminal to install Codex CLI:

```bash theme={null}
npm install -g @openai/codex

```

MacOS users can use Homebrew:

```bash theme={null}
brew install codex
```

2. Configure it to use this platform's models (MacOS/Linux)

Open `~/.codex/config.toml` and configure it as follows:

```
model = "gpt-5"
model_provider = "jiekou"

[model_providers.jiekou]
name = "JIEKOU using Chat Completions"
base_url = "https://api.highwayapi.ai/openai/v1"
env_key = "OPENAI_API_KEY"
wire_api = "chat"
query_params = {}
```

For more detailed configuration options, see the [official documentation](https://github.com/openai/codex/blob/main/docs/config.md).

3. Run Codex CLI

Set this site's ApiKey as an environment variable and run codex:

```bash theme={null}
OPENAI_API_KEY=<API_KEY> codex
```

## Codex VSCode extension

You can also use Codex in VSCode. First configure `~/.codex/config.toml` according to the instructions in the previous section, then run the following command:

```bash theme={null}
{
cat << 'EOF' | tee $HOME/.codex/pcodex.sh
#!/bin/bash
OPENAI_API_KEY=sk_xxx /opt/homebrew/bin/codex "$@"
EOF
chmod +x $HOME/.codex/pcodex.sh
}
```

Then add the following configuration to VSCode settings.json:

```json theme={null}
{
    "chatgpt.cliExecutable": "/home/path/.codex/pcodex.sh"
}
```

Note: please replace `/home/path` with your actual Home directory path.
