opencode-model-toggle
v1.0.1
Published
Quick model switching for OpenCode via editor hotkeys
Maintainers
Readme
opencode-model-toggle
Quick model switching for OpenCode via editor hotkeys. Cycle between your 3 favorite models with a single keystroke instead of navigating the /models menu.
Quick Start
Installation (LLM-assisted)
Paste this into any LLM agent:
Install the opencode-model-toggle plugin by following: https://raw.githubusercontent.com/cloudboy-jh/opencode-mode-toggle/main/README.mdInstallation (Manual)
npm install -g opencode-model-toggleAdd to ~/.config/opencode/opencode.json:
{ "plugin": ["opencode-model-toggle"] }Restart OpenCode and run:
/model-toggle setupCommands
/m # Cycle to next model
/model-toggle # Same as /m
/model-toggle show # Display rotation
/model-toggle set 2 # Jump to model #2
/model-toggle setup # Reconfigure
/model-toggle reset # Restore defaultsConfiguration
Config file: ~/.config/opencode/model-toggle.json
{
"models": [
"claude-sonnet-4.5",
"gemini-2.0-flash-exp",
"claude-haiku-4.5"
],
"currentIndex": 0,
"version": "1.0.0"
}Editor Hotkeys
Zed (~/.config/zed/keymap.json)
{
"bindings": {
"cmd+shift+m": ["task::Spawn", {
"task_name": "Model Toggle",
"command": "opencode",
"args": ["run", "/m"]
}]
}
}VS Code / Cursor (keybindings.json)
{
"key": "cmd+shift+m",
"command": "workbench.action.terminal.sendSequence",
"args": { "text": "opencode run '/m'\n" }
}Development
bun install
bun run dev
bun run build
bun run dev:testLicense
MIT
