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.
Find a file
2026-07-12 10:52:27 +08:00
.gitignore Add ccsw dispatcher and project docs 2026-07-11 22:52:51 +08:00
AGENTS.md Add ccsw dispatcher and project docs 2026-07-11 22:52:51 +08:00
ccsw.sh Add ccsw dispatcher and project docs 2026-07-11 22:52:51 +08:00
LICENSE Add ccsw dispatcher and project docs 2026-07-11 22:52:51 +08:00
README.md Link orms and oms selectors in README 2026-07-12 10:52:27 +08:00

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, and timeout on $PATH
  • orms and/or oms on $PATH
  • An authenticated 1Password CLI session
  • ~/.local/bin on $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.