Run an OpenCode coding task
opencode.runCreate or resume a project-local session to implement a concise coding task in your current project. Options include session reuse and native background subagents.
Instructions
Creates or resumes a project-local OpenCode session and executes a concise task. This may edit the current project.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | A concise implementation instruction. OpenCode reads the current project itself. | |
| model | No | An existing OpenCode provider/model ID. | |
| reuse | No | Reuse a recent compatible primary session; defaults to true. | |
| sessionId | No | An existing OpenCode session ID to resume. | |
| asynchronous | No | Return after OpenCode accepts the task; use sessions to inspect or cancel it. | |
| backgroundSubagents | No | Allow only OpenCode native background subagents for independent work. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| async | Yes | ||
| output | No | ||
| reused | Yes | ||
| status | Yes | ||
| modelId | No | ||
| sessionId | Yes |