A small Bash dispatcher that launches Codex with a model selected through orms (OpenRouter) or oms (Ollama Cloud). API keys are read from 1Password and are never written to disk.
- Shell 100%
| .gitignore | ||
| AGENTS.md | ||
| cxsw.sh | ||
| LICENSE | ||
| README.md | ||
Codex Switch
A small Bash dispatcher that launches Codex CLI with a model selected through orms (OpenRouter) or oms (Ollama Cloud). API keys are read from 1Password and are never written to disk. Provider configuration is passed to Codex for that invocation only, leaving ~/.codex/config.toml unchanged.
Requirements
- Bash 4+
codex,op, andtimeouton$PATHormsand/oromson$PATH- An authenticated 1Password CLI session
~/.local/binon$PATH
The script reads each provider token from the following 1Password references:
op://CLI-Tools/OpenRouter - Codex/credential
op://CLI-Tools/Ollama Cloud - Codex/credential
Install
With curl
Download the latest version from the repository and install it as cxsw:
mkdir -p "$HOME/.local/bin" && curl --fail --silent --show-error --location "https://code.paulg.it/paulgit/codex-code-switch/raw/branch/main/cxsw.sh" --output "$HOME/.local/bin/cxsw" && chmod 755 "$HOME/.local/bin/cxsw"
From a clone
From the cloned repository, install the local copy:
mkdir -p "$HOME/.local/bin" && install -m 755 cxsw.sh "$HOME/.local/bin/cxsw"
Usage
cxsw orms # OpenRouter, using the model selected by orms
cxsw oms # Ollama Cloud, using the model selected by oms
Arguments after the provider are passed through to Codex, for example:
cxsw orms --no-alt-screen
cxsw oms resume
Use /status inside Codex to confirm the active provider and model.
License
This project is released under the WTFPL, version 2.