Codex

Codex is OpenAI’s agentic CLI. In Operator it is an LLM tool (binary codex). OpenAI the API is a separate model provider. Codex speaks the OpenAI protocol, so it can also target Ollama or OpenRouter when a delegator names that model_server.

Status

Beta. Catalog slug codex.

Install

npm i -g @openai/codex

Operator detects it with which codex and codex --version. health_ok means the binary is on this host’s PATH.

Authenticate

export OPENAI_API_KEY="sk-..."

Remote launches need that key in the environment Operator can inject. A local Codex login does not travel to an SSH target.

Launch

Operator does not use [agents.codex] config. Pair the tool in a delegator:

[[delegators]]
name = "codex-gpt"
llm_tool = "codex"
model = "gpt-4o"
# model_server omitted → implicit openai-api

To run Codex against a local Ollama host:

[[model_servers]]
name = "ollama-local"
kind = "ollama"
base_url = "http://localhost:11434"

[[delegators]]
name = "codex-local-qwen"
llm_tool = "codex"
model = "qwen2.5-coder"
model_server = "ollama-local"

Project discovery looks for CODEX.md at the repo root.

Relay

Operator injects relay env vars into Codex sessions. Full MCP tool support for Codex relay is still limited. See Relay.