Run OpenCode CLI
opencode_runRun a locally installed CLI non-interactively in a sandboxed working directory. Supports auto-approve, session continuation, and agent/model selection.
Instructions
Run the locally installed, logged-in OpenCode CLI non-interactively in a sandboxed working directory. auto_approve enables side-effecting actions and requires server-side write permission. Supports session continuation and agent/model selection.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | Yes | Absolute path to an allowed working directory. | |
| agent | No | Named OpenCode agent. | |
| model | No | provider/model override. | |
| prompt | Yes | Instructions for OpenCode. | |
| session_id | No | Existing session id (ses_...) to continue. | |
| output_mode | No | final summary or full raw events. | final |
| auto_approve | No | Auto-approve actions (write). Requires AGENT_ALLOW_WRITE. | |
| timeout_seconds | No | Timeout in seconds (10-3600). |