Answer: Create a custom slash command by adding a .md file: put global commands in ~/.config/opencode/commands/ and project commands in .opencode/commands/. Only .md files are discovered, and nested paths become command names with / separators. Status: Confirmed Entry: tool/opencode/commands-and-shortcuts/create-custom-command Revision: 1 Digest: sha256:94f238c90a6937c6 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:56:32Z Last changed: 2026-11-13T03:56:32Z Last verified: 2026-11-20T13:45:30Z Next check: 2026-11-21T13:45:30Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of global commands directory | ~/.config/opencode/commands/ | [1] | 2026-11-20 project commands directory | .opencode/commands/ | [1] | 2026-11-20 file type | .md | [1] | 2026-11-20 nested path example | .opencode/commands/team/review.md | [1] | 2026-11-20 nested command usage | /team/review src/auth.ts | [1] | 2026-11-20 legacy directory | command/ | [1] | 2026-11-20 Sources: [1] opencode. "Commands | OpenCode". https://opencode.ai/docs/commands/ Role: primary. Accessed: 2026-11-20T13:45:30Z Quote: "Put global commands in ~/.config/opencode/commands/ and project commands in .opencode/commands/ ." (Supports: global commands directory, project commands directory) Quote: "Only .md files are discovered." (Supports: file type) Quote: "Nested paths become command names with / separators: .opencode/commands/team/review.md" (Supports: nested path example) Quote: "Run the nested command as /team/review src/auth.ts ." (Supports: nested command usage) Quote: "The legacy singular directory command/ is also discovered, but use commands/ for new files." (Supports: legacy directory) Snapshot SHA-256: ab163966231508aa8c5aa4acce2e91d6717fa361fbdc8d51624bd9f7706104f9 (captured 2026-11-13T03:56:32Z) 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-13T03:56:32Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:45:30Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:45:30Z Last attempt: 2026-11-20T13:45:30Z Notes and limitations: Extracted automatically from a single official source (section "Markdown"). Related: https://latestn.com/tool/opencode/commands-and-shortcuts/customize-keybindings How do I customize keybindings in opencode? https://latestn.com/tool/opencode/commands-and-shortcuts/disable-keybinding How do I disable a keybinding in opencode? https://latestn.com/tool/opencode/commands-and-shortcuts/insert-new-line How do I insert a new line in the opencode TUI prompt? https://latestn.com/tool/opencode/commands-and-shortcuts/auth-login-cli How do I log in to a provider from the opencode CLI without opening the TUI? https://latestn.com/tool/opencode/commands-and-shortcuts/cancel-staged-rollback How do I cancel a staged rollback in opencode? https://latestn.com/tool/opencode/commands-and-shortcuts/command-arguments How do I pass arguments to an opencode command? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:56:32Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/opencode/commands-and-shortcuts/create-custom-command/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/create-custom-command POST: https://latestn.com/dispute/tool/opencode/commands-and-shortcuts/create-custom-command with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/opencode/commands-and-shortcuts/create-custom-command?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I create a custom slash command in opencode? Revision 1, last verified 2026-11-20T13:45:30Z. https://latestn.com/tool/opencode/commands-and-shortcuts/create-custom-command (accessed 2026-11-21T09:54:07Z). @misc{LatestN_tool_opencode_commands_and_shortcuts_create_custom_command_r1, title = {How do I create a custom slash command in opencode?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/opencode/commands-and-shortcuts/create-custom-command}}, note = {Revision 1; digest sha256:94f238c90a6937c6; last verified 2026-11-20T13:45:30Z; accessed 2026-11-21T09:54:07Z} } 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/create-custom-command