A small Bash dispatcher that launches Claude Code 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 | ||
| ccsw.sh | ||
| LICENSE | ||
| README.md | ||
Claude Code Switch
A small Bash dispatcher that launches Claude Code with a model selected through orms (OpenRouter) or oms (Ollama Cloud). API keys are read from 1Password and are never written to disk.
Requirements
- Bash 4+
claude,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 - Claude/credential
op://CLI-Tools/Ollama Cloud - Claude/credential
Install
With curl
Download the latest version from the repository and install it as ccsw:
mkdir -p "$HOME/.local/bin" && curl --fail --silent --show-error --location "https://code.paulg.it/paulgit/claude-code-switch/raw/branch/main/ccsw.sh" --output "$HOME/.local/bin/ccsw" && chmod 755 "$HOME/.local/bin/ccsw"
From a clone
From the cloned repository, install the local copy:
mkdir -p "$HOME/.local/bin" && install -m 755 ccsw.sh "$HOME/.local/bin/ccsw"
Usage
ccsw orms # OpenRouter, using the model selected by orms
ccsw oms # Ollama Cloud, using the model selected by oms
Use /status inside Claude Code to confirm the active provider and model.
If Claude Code was previously authenticated directly with Anthropic and reports a model-not-found error, run /logout once, quit Claude Code, and relaunch with ccsw.
License
This project is released under the WTFPL, version 2.