codex-cli-switcher (cxsw)
cxsw flips the OpenAI Codex CLI between three backends with one command:
native (your ChatGPT subscription), cliproxy (local CLIProxyAPI), and
9router.
Design principles
- Never clobber user config — edits only its own marker-fenced blocks in
~/.codex/config.toml; projects, plugins, marketplaces, and comments survive. - Refuse unsafe switches — won't swap backends while Codex.app or an
interactive
codexsession is live and could keep stale auth. - Diagnose, don't guess — probes backend health, detects plugin/marketplace mismatches that trigger crash overlays, repairs session indexes.
Distribution
Published to npm as codex-cli-switcher with zero runtime npm dependencies —
just zsh, python3, curl, and sqlite3.
npm install -g codex-cli-switcher
cxsw use cliproxy