opencode
opencode copied to clipboard
feat(tui): add configurable status line hints
What does this PR do?
Adds support for customizable status hints in the TUI footer, allowing users to control which keybind hints are displayed.
Features:
- New
tui.status_hintsconfig section withenabledflag anditemsarray - Default hints:
agent_cycle,variant_cycle(conditional),command_list - Conditional hint display (e.g.,
variant_cycleonly shows when variants exist) - Users can customize which hints to show and their labels
- Backwards compatible - uses defaults when not configured
Example Configuration:
{
"tui": {
"status_hints": {
"enabled": true,
"items": [
{ "keybind": "agent_cycle", "label": "switch agent" },
{ "keybind": "variant_cycle", "label": "switch variants", "when": "hasVariants" },
{ "keybind": "command_list", "label": "commands" }
]
}
}
}
This implementation follows the design proposed in issue #6240.
Closes #6240
How did you verify your code works?
-
Built locally: Ran
./packages/opencode/script/build.ts --singleto verify build success. - Tested Defaults: Verified that running without config shows the default hints (Agent, Variant (if available), Commands).
-
Tested Variant Logic: Verified
variant_cyclehint appears only when a model with variants (e.g.,antigravity-claude-opus-4-5-thinking) is selected, and hides for others. -
Tested Custom Config: Verified that
OPENCODE_CONFIGwithstatus_hintscorrectly changes the footer order and labels.