Answer: Use the Shell tool, which executes a command in the host user's shell. Set workdir instead of putting cd in the command, and set timeout in milliseconds when the default two-minute foreground timeout is not suitable. Status: Overdue (check was due 2026-11-20T13:37:31Z and has not succeeded) Entry: tool/opencode/commands-and-shortcuts/run-shell-commands Revision: 1 Digest: sha256:33e9abe48b79a5cc (changes whenever the content changes) Timeline: Created: 2026-11-13T03:58:18Z Last changed: 2026-11-13T03:58:18Z Last verified: 2026-11-19T13:37:31Z Next check: 2026-11-20T13:37:31Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of tool | Shell | [1] | 2026-11-19 default foreground timeout | two-minute | [1] | 2026-11-19 timeout unit | milliseconds | [1] | 2026-11-19 working directory setting | workdir | [1] | 2026-11-19 background setting | background | [1] | 2026-11-19 Sources: [1] opencode. "Tools | OpenCode". https://opencode.ai/docs/tools/ Role: primary. Accessed: 2026-11-19T13:37:31Z Quote: "Shell shell executes a command in the host user’s shell." (Supports: tool) Quote: "set timeout in milliseconds when the default two-minute foreground timeout is not suitable" (Supports: default foreground timeout, timeout unit) Quote: "Set workdir instead of putting cd in the command" (Supports: working directory setting) Quote: "Set background to true for a dev server or another long-running process." (Supports: background setting) Snapshot SHA-256: 87641bde20c614458e91d184df4584731eb549e55efd40138a7bd7aee834e14f (captured 2026-11-13T03:58:16Z) 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:58:18Z, so the values verified then were kept. Cross-check: not-available at 2026-11-19T13:37:31Z. No independent second source is configured for this entry Last successful check: 2026-11-19T13:37:31Z Last attempt: 2026-11-19T13:37:31Z Notes and limitations: Extracted automatically from a single official source (section "Shell"). Related: 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/opencode/commands-and-shortcuts/tui-plugin-commands-keymaps How do I add custom commands and keymaps in an opencode TUI plugin? https://latestn.com/tool/opencode/commands-and-shortcuts/rollback-shortcuts What keyboard shortcuts does opencode use to stage or cancel a rollback? https://latestn.com/tool/opencode/commands-and-shortcuts/run-non-interactive-prompt How do I run a single opencode prompt without opening the interactive interface? https://latestn.com/tool/opencode/commands-and-shortcuts/run-shell-command How do I run a shell command in opencode TUI? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:58:18Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/opencode/commands-and-shortcuts/run-shell-commands/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/run-shell-commands POST: https://latestn.com/dispute/tool/opencode/commands-and-shortcuts/run-shell-commands with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/opencode/commands-and-shortcuts/run-shell-commands?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I run shell commands with opencode? Revision 1, last verified 2026-11-19T13:37:31Z. https://latestn.com/tool/opencode/commands-and-shortcuts/run-shell-commands (accessed 2026-11-21T09:57:23Z). @misc{LatestN_tool_opencode_commands_and_shortcuts_run_shell_commands_r1, title = {How do I run shell commands with opencode?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/opencode/commands-and-shortcuts/run-shell-commands}}, note = {Revision 1; digest sha256:33e9abe48b79a5cc; last verified 2026-11-19T13:37:31Z; accessed 2026-11-21T09:57:23Z} } 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/run-shell-commands