opencode
opencode copied to clipboard
feat: add model/agent slot keybinds for direct switching
Summary
- Add
model_slot_1-5keybinds to jump directly to favorite models - Add
agent_slot_1-5keybinds to jump directly to agents by index - Add
setFavorite(index)method to model store - Add
setSlot(index)method to agent store
Motivation
Currently switching models requires cycling through all favorites with Tab/F2. This PR enables direct keybind mapping for faster workflow - press F1 for favorite model 1, f5 for agent 1, etc.
Example Config
"keybinds": {
"model_cycle_recent": "none",
"model_slot_1": "f1",
"model_slot_2": "f2",
"model_slot_3": "f3",
"agent_slot_1": "f5",
"agent_slot_2": "f6"
}
Files Changed
-
packages/opencode/src/config/config.ts- Add 10 keybind entries -
packages/opencode/src/cli/cmd/tui/context/local.tsx- Add setFavorite/setSlot methods -
packages/opencode/src/cli/cmd/tui/app.tsx- Register slot commands