You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace OpenCode Web UI with SDK client pattern (#120)
* Replace OpenCode Web UI section with SDK client pattern
Switch from browser-based `opencode web` to programmatic `opencode serve`
+ SDK client approach, which better fits developers building agent workflows.
* Fix OpenCode SDK usage and add server health check
- Use JS/TS SDK only, Python tab uses plain HTTP requests
- Add health check polling loop to wait for server startup
- Fix session.create/prompt calls to match SDK docs
* Remove auto-pause warning from OpenCode SDK section
Copy file name to clipboardExpand all lines: docs/agents/opencode.mdx
+64-29Lines changed: 64 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,55 +111,90 @@ sandbox.kill()
111
111
```
112
112
</CodeGroup>
113
113
114
-
## Launch the web UI
114
+
## Connect with the OpenCode SDK
115
115
116
-
OpenCode has a [built-in web interface](https://opencode.ai/docs/web/). Start it inside a sandbox and connect from your browser.
117
-
118
-
<Warning>
119
-
This sandbox is created with a 10-minute timeout and auto-pause enabled — after 10 minutes of inactivity it pauses and can be resumed later. See [Sandbox Persistence](/docs/sandbox/persistence) and [Sandbox Lifecycle](/docs/sandbox) for more details.
120
-
</Warning>
116
+
OpenCode includes a [headless HTTP server](https://opencode.ai/docs/server/) that you can control programmatically using the [`@opencode-ai/sdk`](https://opencode.ai/docs/sdk/) client. Start the server inside a sandbox, get the public URL with `sandbox.getHost()`, and connect from your application.
0 commit comments