codexswitch is a small CLI tool for managing multiple Codex provider configs and quickly switching the active one.
- Add provider configs (
add) - Edit existing provider configs (
edit) - Remove provider configs (
remove) - Copy provider configs with auto suffix (
copy/replicate) - List all configured providers (
list) - Switch active provider from CLI (
switch --slug) or interactive menu (default command) - Sync provider store via WebDAV (
sync push|pull) - Configurable
reasoning-effort(none|minimal|low|medium|high|xhigh, defaultmedium)
Provider files are stored in ~/.codexswitch/<slug>/, and activation copies files to ~/.codex/.
Provider slug must match [a-z0-9_-] (1-64 chars, cannot start with .).
go build -o codexswitch .CGO_ENABLED=0 go build -trimpath -ldflags='-s -w' -o codexswitch-static .Run the Release workflow manually (workflow_dispatch) in GitHub Actions.
The workflow builds static binaries for Linux, macOS, and Windows, then publishes them to a GitHub Release.
The release tag is automatically set to the current UTC date (format: YYYY-MM-DD).
Release assets include:
codexswitch-linux-amd64codexswitch-macos-amd64codexswitch-macos-arm64codexswitch-windows-amd64.exeSHA256SUMS
codexswitch add \
--slug openai \
--name OpenAI \
--api-key sk-xxx \
--model gpt-4.1 \
--base-url https://api.openai.com/v1 \
--wire-api responses \
--reasoning-effort mediumIf flags are missing in a TTY, prompts will ask for missing fields (including reasoning-effort).
codexswitch listcodexswitch
codexswitch switch --slug openaicodexswitch switch also supports interactive provider selection in a TTY.
codexswitch edit --slug openai --model gpt-4.1-mini
codexswitch edit --slug openai --reasoning-effort highWithout --slug in interactive mode, you can select a provider from a menu.
codexswitch remove --slug openai
codexswitch remove --slug openai --yesThe active provider cannot be removed directly.
codexswitch copy --slug openai
codexswitch replicate --slug openaiCreates a new provider using <slug>-copyN and <DisplayName> copyN (for example openai-copy1) without switching the active provider.
Upload your local ~/.codexswitch to a WebDAV file URL:
codexswitch sync push --webdav-url https://example.com/dav/codexswitch.tar.gzDownload from WebDAV and replace your local store (backs up existing ~/.codexswitch by default):
codexswitch sync pull --webdav-url https://example.com/dav/codexswitch.tar.gzYou can also set credentials via environment variables:
export CODEXSWITCH_WEBDAV_URL="https://example.com/dav/codexswitch.tar.gz"
export CODEXSWITCH_WEBDAV_USER="alice"
export CODEXSWITCH_WEBDAV_PASS="secret"
codexswitch sync pushOr persist WebDAV settings in ~/.codexswitch/.webdav.json. If sync push/pull runs in a TTY and no --webdav-url/CODEXSWITCH_WEBDAV_URL is provided, it will prompt you for the missing fields and save this file automatically.
go test ./...Show help:
codexswitch --help
codexswitch switch --help
codexswitch add --help
codexswitch edit --help
codexswitch remove --help
codexswitch copy --help