Keyboard Shortcuts
Primary Keybindings
| Shortcut | Action |
|---|---|
Tab | Switch between primary agents (Build / Plan) |
ctrl+p | Open command palette |
ctrl+t | Cycle through model variants |
ctrl+c | Cancel current generation |
File and Navigation
| Shortcut | Action |
|---|---|
@ | File reference fuzzy search |
/ | Slash commands |
! | Bash command prefix (start message line with !) |
Up / Down | Navigate message history when input is empty |
Session Tree Navigation
| Shortcut | Action |
|---|---|
Leader+Down | Enter first child session |
Up (at parent session prompt) | Return to parent session |
Right | Switch to next child session |
Down (at last child prompt) | Enter new child session |
Left | Switch to previous child session |
The default leader key is ctrl+x.
Session Management (ctrl+x prefix)
| Shortcut | Action |
|---|---|
ctrl+x c | Compact / summarize session |
ctrl+x e | Open external editor |
ctrl+x q | Exit OpenCode |
ctrl+x x | Export conversation to Markdown |
ctrl+x m | List and switch models |
ctrl+x n | Start new session |
ctrl+x r | Redo last undone change |
ctrl+x l | List all sessions |
ctrl+x t | List available themes |
ctrl+x u | Undo last change |
Selection and Copy
| Shortcut | Action |
|---|---|
ctrl+a | Select all (in input area) |
ctrl+shift+c | Copy selected text |
ctrl+shift+v | Paste |
ctrl+left / ctrl+right | Jump word by word in input |
ctrl+u | Clear input line |
ctrl+w | Delete word before cursor |
alt+backspace | Delete word before cursor |
ctrl+backspace | Delete word before cursor |
Scrolling
| Shortcut | Action |
|---|---|
ctrl+up | Scroll output up |
ctrl+down | Scroll output down |
pgup | Scroll output page up |
pgdn | Scroll output page down |
home | Scroll to beginning of output |
end | Scroll to end of output |
Customizing Keybinds
Keybindings can be customized in tui.json under the keybinds section:
{
"keybinds": [
{
"keys": ["ctrl+p"],
"action": "command_palette"
},
{
"keys": ["ctrl+x", "c"],
"action": "compact"
},
{
"keys": ["alt+t"],
"action": "cycle_models"
}
]
}
Custom Action Examples
{
"keybinds": [
{
"keys": ["f1"],
"action": "help"
},
{
"keys": ["ctrl+shift+e"],
"action": "export"
},
{
"keys": ["alt+1"],
"action": "agent_switch",
"args": { "agent": "build" }
},
{
"keys": ["alt+2"],
"action": "agent_switch",
"args": { "agent": "plan" }
},
{
"keys": ["ctrl+o"],
"action": "external_editor"
},
{
"keys": ["ctrl+s"],
"action": "compact"
},
{
"keys": ["alt+down"],
"action": "scroll_down"
},
{
"keys": ["alt+up"],
"action": "scroll_up"
}
]
}
Available Actions
| Action | Description |
|---|---|
command_palette | Open command palette |
compact | Compact/summarize session |
external_editor | Open external editor |
exit | Exit OpenCode |
export | Export to Markdown |
list_models | List and switch models |
new_session | Start new session |
redo | Redo last change |
list_sessions | List sessions |
list_themes | List themes |
undo | Undo last change |
cycle_models | Cycle model variants |
agent_switch | Switch to specific agent (requires args.agent) |
help | Open help |
scroll_up | Scroll output up |
scroll_down | Scroll output down |
select_all | Select all input text |
Theme Support for Dimmed/Disabled Shortcuts
Some keybindings display dimmed or disabled when the associated feature is unavailable. This visual feedback is theme-dependent and controlled by the theme's disabled style in tui.json.