OpenCode keyboard shortcuts

OpenCode exposes a large, remappable TUI keymap. This page covers the current default leader chords, session and model controls, message navigation, prompt editing, dialogs, and the desktop prompt layer.

Windows, macOS, Linux · 88 shortcuts

Leader and app controls

Learn the leader first, then use the command list, editor, theme, sidebar, status, and exit controls around the TUI.

ActionWindowsmacOSLinux
Leader keyCtrlXCtrlXCtrlX
Open the command listCtrlPCtrlPCtrlP
Exit OpenCodeCtrl+X then Q is a leader sequence. Ctrl+C and Ctrl+D are direct bindings.CtrlCorCtrlDorCtrlXQCtrlCorCtrlDorCtrlXQCtrlCorCtrlDorCtrlXQ
Open the external editor for the promptUses the editor in EDITOR or the configured editor.CtrlXECtrlXECtrlXE
List themesCtrlXTCtrlXTCtrlXT
Show the status viewCtrlXSCtrlXSCtrlXS
Open the which-key help overlayCtrlAltKCtrlAltKCtrlAltK
Change the which-key layoutCtrlAltShiftKCtrlAltShiftKCtrlAltShiftK
Toggle pending which-key displayCtrlAltShiftPCtrlAltShiftPCtrlAltShiftP

Sessions and tree navigation

Create, switch, export, rename, compact, delete, and move through the current session tree without leaving the conversation.

ActionWindowsmacOSLinux
Start a new sessionCtrlXNCtrlXNCtrlXN
List sessionsCtrlXLCtrlXLCtrlXL
Export the sessionCtrlXXCtrlXXCtrlXX
Show the session timelineCtrlXGCtrlXGCtrlXG
Rename the sessionCtrlRCtrlRCtrlR
Delete the sessionCtrlDCtrlDCtrlD
Interrupt the current sessionEscEscEsc
Compact the session contextCtrlXCCtrlXCCtrlXC
Jump to the first child sessionCtrlXDownCtrlXDownCtrlXDown
Cycle to the next child sessionRightRightRight
Cycle to the previous child sessionLeftLeftLeft
Jump to the parent sessionUpUpUp

Models and agents

Change the provider, model, favorite state, agent, and variant while keeping the current session in place.

ActionWindowsmacOSLinux
List model providersCtrlACtrlACtrlA
Toggle the current model as a favoriteCtrlFCtrlFCtrlF
List modelsCtrlXMCtrlXMCtrlXM
Cycle recent models forwardShift+F2 cycles recent models backward.F2F2F2
Cycle recent models backwardShiftF2ShiftF2ShiftF2
List agentsCtrlXACtrlXACtrlXA
Cycle agents forwardTabTabTab
Cycle agents backwardShiftTabShiftTabShiftTab
Cycle model variantsCtrlTCtrlTCtrlT

Messages and response history

Move through long responses, jump to the first or last message, copy or undo message state, and change how details are shown.

ActionWindowsmacOSLinux
Page up through messagesPageUporCtrlAltBPageUporCtrlAltBPageUporCtrlAltB
Page down through messagesPageDownorCtrlAltFPageDownorCtrlAltFPageDownorCtrlAltF
Move up one message lineCtrlAltYCtrlAltYCtrlAltY
Move down one message lineCtrlAltECtrlAltECtrlAltE
Move up half a pageCtrlAltUCtrlAltUCtrlAltU
Move down half a pageCtrlAltDCtrlAltDCtrlAltD
Jump to the first messageCtrlGorHomeCtrlGorHomeCtrlGorHome
Jump to the last messageCtrlAltGorEndCtrlAltGorEndCtrlAltGorEnd
Copy the current messageCtrlXYCtrlXYCtrlXY
Undo the last message actionCtrlXUCtrlXUCtrlXU
Redo the last message actionCtrlXRCtrlXRCtrlXR
Toggle concealed message detailsCtrlXHCtrlXHCtrlXH

Prompt editing

Edit the prompt with Readline-style movement, selection, deletion, undo, redo, history, and multiline input controls.

ActionWindowsmacOSLinux
Clear the promptCtrlCCtrlCCtrlC
Paste into the promptCtrlVCtrlVCtrlV
Submit the promptEnterEnterEnter
Insert a newline without submittingSome terminals need explicit Shift+Enter configuration.ShiftEnterorCtrlEnterorAltEnterorCtrlJShiftEnterorCtrlEnterorAltEnterorCtrlJShiftEnterorCtrlEnterorAltEnterorCtrlJ
Move left one characterLeftorCtrlBLeftorCtrlBLeftorCtrlB
Move right one characterRightorCtrlFRightorCtrlFRightorCtrlF
Move up one prompt lineUpUpUp
Move down one prompt lineDownDownDown
Move to the start of the lineCtrlACtrlACtrlA
Move to the end of the lineCtrlECtrlECtrlE
Move to the start of the promptHomeHomeHome
Move to the end of the promptEndEndEnd
Select left one characterShiftLeftShiftLeftShiftLeft
Select right one characterShiftRightShiftRightShiftRight
Select to the start of the lineCtrlShiftACtrlShiftACtrlShiftA
Select to the end of the lineCtrlShiftECtrlShiftECtrlShiftE
Delete the current lineCtrlShiftDCtrlShiftDCtrlShiftD
Delete to the end of the lineCtrlKCtrlKCtrlK
Delete to the start of the lineCtrlUCtrlUCtrlU
Delete the previous characterBackspaceorShiftBackspaceBackspaceorShiftBackspaceBackspaceorShiftBackspace
Delete the next characterCtrlDorDeleteorShiftDeleteCtrlDorDeleteorShiftDeleteCtrlDorDeleteorShiftDelete
Undo prompt editingSuper is the platform's Super or Command key.Ctrl-orSuperZCtrl-orSuperZCtrl-orSuperZ
Redo prompt editingSuper is the platform's Super or Command key.Ctrl.orSuperShiftZCtrl.orSuperShiftZCtrl.orSuperShiftZ
Move forward one wordAltForAltRightorCtrlRightAltForAltRightorCtrlRightAltForAltRightorCtrlRight
Move backward one wordAltBorAltLeftorCtrlLeftAltBorAltLeftorCtrlLeftAltBorAltLeftorCtrlLeft
Delete the next wordAltDorAltDeleteorCtrlDeleteAltDorAltDeleteorCtrlDeleteAltDorAltDeleteorCtrlDelete
Delete the previous wordCtrlWorCtrlBackspaceorAltBackspaceCtrlWorCtrlBackspaceorAltBackspaceCtrlWorCtrlBackspaceorAltBackspace
Select all prompt textSuper is the platform's Super or Command key.SuperASuperASuperA
Previous prompt history entryUpUpUp
Next prompt history entryDownDownDown

Dialogs, completion, and terminal

Move through selection dialogs, accept completions, handle permissions, and use the terminal controls that surround the TUI.

ActionWindowsmacOSLinux
Previous dialog itemUporCtrlPUporCtrlPUporCtrlP
Next dialog itemDownorCtrlNDownorCtrlNDownorCtrlN
Page up in a dialogPageUpPageUpPageUp
Page down in a dialogPageDownPageDownPageDown
Jump to the first dialog itemHomeHomeHome
Jump to the last dialog itemEndEndEnd
Confirm a dialog selectionEnterEnterEnter
Toggle an MCP selectionSpaceSpaceSpace
Previous autocomplete itemUporCtrlPUporCtrlPUporCtrlP
Next autocomplete itemDownorCtrlNDownorCtrlNDownorCtrlN
Hide autocompleteEscEscEsc
Select the autocomplete itemEnterEnterEnter
Complete the current tokenTabTabTab
Open a permission prompt full-screenCtrlFCtrlFCtrlF
Suspend OpenCode to the shellThe current docs disable terminal suspension on Windows; use fg to resume on Unix-like systems.Not documentedCtrlZCtrlZ

Make a printable OpenCode sheet