Skip to content

Replace OpenCode Web UI with SDK client pattern#120

Merged
beran-t merged 3 commits intomainfrom
opencode-sdk-pattern
Feb 19, 2026
Merged

Replace OpenCode Web UI with SDK client pattern#120
beran-t merged 3 commits intomainfrom
opencode-sdk-pattern

Conversation

@beran-t
Copy link
Copy Markdown
Contributor

@beran-t beran-t commented Feb 18, 2026

Summary

  • Replaces the "Launch the Web UI" section with "Connect with the OpenCode SDK" — uses opencode serve (headless server) + SDK client instead of opencode web (browser-based)
  • JS/TS tab uses @opencode-ai/sdk with createOpencodeClient, Python tab uses opencode-ai with Opencode(base_url=...)
  • Adds background: true to the server command (fixes the original blocking call)
  • Updates custom template section to use opencode serve consistently

Switch from browser-based `opencode web` to programmatic `opencode serve`
+ SDK client approach, which better fits developers building agent workflows.
- 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
Copy link
Copy Markdown
Contributor

@matthewlouisbrockman matthewlouisbrockman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simpler opencode example, nice

@beran-t beran-t merged commit 9466c98 into main Feb 19, 2026
6 checks passed
@beran-t beran-t deleted the opencode-sdk-pattern branch February 19, 2026 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants