Answer: You register palette, slash, and keyboard commands in a reactive keymap layer by calling context.keymap.layer() with a factory returning an object containing mode, priority, commands (each with id, title, group, bind, palette, slash, enabled, suggested, run), and bindings. Call the layer from setup, including after an await, or from a component. Status: Confirmed Entry: tool/opencode/commands-and-shortcuts/tui-plugin-commands-keymaps Revision: 2 Digest: sha256:26ec810c5fa85946 (changes whenever the content changes) Timeline: Created: 2026-11-15T13:52:49Z Last changed: 2026-11-19T13:34:41Z (bindings: — → acme.status) Last verified: 2026-11-20T13:44:29Z Next check: 2026-11-21T13:44:29Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of mode | global | [1] | 2026-11-20 priority | 10 | [1] | 2026-11-20 example command id | acme.status | [1] | 2026-11-20 example bind | ctrl+g | [1] | 2026-11-20 slash name | acme | [1] | 2026-11-20 bindings | acme.status | [1] | 2026-11-20 where to call layer | Call layer from setup , including after an await , or from a component. | [1] | 2026-11-20 Sources: [1] opencode. "Building TUI plugins | OpenCode". https://opencode.ai/docs/build/plugins/cli/ Role: primary. Accessed: 2026-11-20T13:44:29Z Quote: "mode : "global"" (Supports: mode) Quote: "priority : 10" (Supports: priority) Quote: "id : "acme.status"" (Supports: example command id) Quote: "bind : "ctrl+g"" (Supports: example bind) Quote: "slash : { name : "acme"" (Supports: slash name) Quote: "bindings : [ "acme.status" ]" (Supports: bindings) Quote: "Call layer from setup , including after an await , or from a component." (Supports: where to call layer) Snapshot SHA-256: 32429ffb8f3f458756c2be453fc1da3c8da59b96466f57cad07715af7be04446 (captured 2026-11-18T13:38:08Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-18T13:38:08Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:44:29Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:44:29Z Last attempt: 2026-11-20T13:44:29Z Notes and limitations: Extracted automatically from a single official source (section "Commands and keymaps"). Related: https://latestn.com/tool/opencode/commands-and-shortcuts/undo-recent-changes How do I undo recent conversation and file changes in opencode? https://latestn.com/tool/opencode/commands-and-shortcuts/use-slash-commands How do I use slash commands in opencode TUI? https://latestn.com/tool/opencode/commands-and-shortcuts/view-command-help-flags How do I see the full list of flags for an opencode command? https://latestn.com/tool/opencode/commands-and-shortcuts/run-shell-commands How do I run shell commands with opencode? https://latestn.com/tool/opencode/commands-and-shortcuts/set-leader-key How do I set the leader key in opencode? https://latestn.com/tool/opencode/commands-and-shortcuts/shell-in-commands How do I run shell commands from an opencode command? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-19T13:34:41Z | changed | bindings: — → acme.status | [1] 2026-11-19T13:34:41Z | changed | slash name: — → acme | [1] 2026-11-19T13:34:41Z | changed | example bind: — → ctrl+g | [1] 2026-11-19T13:34:41Z | changed | priority: — → 10 | [1] 2026-11-19T13:34:41Z | changed | mode: — → global | [1] 2026-11-19T13:34:41Z | changed | where to call layer: Call layer from setup → Call layer from setup , including after an await , or from a component. | [1] 2026-11-19T13:34:41Z | changed | example mode: global → — | [1] 2026-11-19T13:34:41Z | changed | example priority: 10 → — | [1] 2026-11-19T13:34:41Z | changed | example slash name: acme → — | [1] 2026-11-19T13:34:41Z | changed | example key binding: ctrl+g → — | [1] 2026-11-15T13:52:49Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/opencode/commands-and-shortcuts/tui-plugin-commands-keymaps/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/opencode/commands-and-shortcuts/tui-plugin-commands-keymaps POST: https://latestn.com/dispute/tool/opencode/commands-and-shortcuts/tui-plugin-commands-keymaps with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/opencode/commands-and-shortcuts/tui-plugin-commands-keymaps?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I add custom commands and keymaps in an opencode TUI plugin? Revision 2, last verified 2026-11-20T13:44:29Z. https://latestn.com/tool/opencode/commands-and-shortcuts/tui-plugin-commands-keymaps (accessed 2026-11-21T09:58:37Z). @misc{LatestN_tool_opencode_commands_and_shortcuts_tui_plugin_commands_keymaps_r2, title = {How do I add custom commands and keymaps in an opencode TUI plugin?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/opencode/commands-and-shortcuts/tui-plugin-commands-keymaps}}, note = {Revision 2; digest sha256:26ec810c5fa85946; last verified 2026-11-20T13:44:29Z; accessed 2026-11-21T09:58:37Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/opencode/commands-and-shortcuts/tui-plugin-commands-keymaps