Codex Commands
Codex Commands
Section titled “Codex Commands”All Codex commands use the swixter codex prefix. Codex uses TOML config with environment variable references.
create
Section titled “create”Create a new profile for Codex.
swixter codex create <name>Important: Codex only supports wire_api: "chat" providers (OpenAI-compatible). Anthropic is filtered out.
The interactive prompt includes an additional envKey option for customizing the environment variable used for the API key.
Options:
| Flag | Description |
|---|---|
-p, --provider <id> | Provider ID |
-k, --api-key <key> | API key |
-u, --base-url <url> | Custom base URL |
-m, --model <model> | Default model |
-e, --env-key <key> | Custom environment variable name |
switch
Section titled “switch”Set the active profile for Codex.
swixter codex switch <name>List all Codex profiles.
swixter codex listWrite the active profile to ~/.codex/config.toml.
swixter codex applyCreates [model_providers.swixter-<name>] and [profiles.swixter-<name>] tables. Uses env_key references instead of storing plaintext keys.
Apply the profile, set environment variables, and launch Codex — all in one command.
swixter codex runThis is the recommended way to use Codex with Swixter. It:
- Applies the active profile to
config.toml - Exports the API key as the required environment variable
- Spawns
codex
Modify an existing profile.
swixter codex edit <name>delete
Section titled “delete”Remove a profile.
swixter codex delete <name>install
Section titled “install”Install the Codex CLI.
swixter codex installupdate-cli
Section titled “update-cli”Update the Codex CLI.
swixter codex update-cliEnvironment Variables
Section titled “Environment Variables”Codex profiles use an environment variable reference (env_key) to reference the API key:
| Priority | Source |
|---|---|
| 1 | Profile-specific envKey (if set) |
| 2 | Provider default env_key (e.g., OLLAMA_API_KEY for Ollama) |
| 3 | OPENAI_API_KEY (fallback) |
To see what env vars your profile uses:
swixter codex envThis outputs export commands for setting up your environment.