Repository navigation
feat: add OpenCode plugin support (@browserbasehq/opencode) - #7
Conversation
Add @browserbasehq/opencode npm package for OpenCode integration:
- Support both OpenCode 1 and OpenCode 2 from the same package
- Bundle browse CLI skill for agent browser automation
- Inject BROWSERBASE_API_KEY and BROWSERBASE_PROJECT_ID into shell env
- Update README and docs with OpenCode install instructions
Install with:
opencode plugin add @browserbasehq/opencode
npm install -g browse
Or add to opencode.jsonc:
{ "plugins": ["@browserbasehq/opencode"] }
The package follows the same pattern as @firecrawl/opencode:
- index.ts exports both v1 (server()) and v2 (id + setup())
- skills.ts loads bundled SKILL.md files
- v1.ts implements OpenCode 1 plugin hooks
- v2.ts implements OpenCode 2 plugin setup
Co-authored-by: Shrey Pandya <shrey150@yahoo.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
- Add .github/workflows/publish-opencode.yml for OIDC trusted publishing - Triggers on version change in opencode/package.json on push to main - Also supports workflow_dispatch for manual runs - Uses id-token: write permission for npm OIDC (no NPM_TOKEN secret) - Idempotent: skips if version already published - Runs type check before publishing - Replace hand-rolled YAML frontmatter parser with gray-matter dependency - More robust parsing of SKILL.md frontmatter - Handles edge cases like block scalars correctly - Update docs/add-a-plugin.md - Document CI publishing workflow - Add first-time setup instructions for trusted publishing - Clarify manual vs automated publishing paths Co-authored-by: Shrey Pandya <shrey150@yahoo.com>
Clarify that npm packages are one of several OpenCode plugin distribution methods (not the only/canonical way). Addresses review feedback. Co-authored-by: Shrey Pandya <shrey150@yahoo.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 939a22a. Configure here.
npm trusted publishing with --provenance requires npm 11.5.1+, which is bundled with Node 22.14+. Node 20's npm 10 doesn't support OIDC auth. Co-authored-by: Shrey Pandya <shrey150@yahoo.com>

Summary
Adds official OpenCode support for the browse CLI, making Browserbase browser automation available to OpenCode users with the same quality bar as other supported agents (Claude Code, Cursor, Codex, Grok, Muse Code, Gemini CLI, Antigravity).
OpenCode vs other agent marketplaces
Unlike Claude/Cursor/Codex/Grok/Muse/Gemini/Antigravity which use static JSON manifests, OpenCode distributes plugins as npm packages. The official distribution channels are:
opencode plugin add <pkg>orpluginsinopencode.json(c).opencode/skills/<name>/SKILL.mdThis PR implements channel #1 with bundled skills and CI publishing.
Changes
New files
.github/workflows/publish-opencode.ymlopencode/package.json@browserbasehq/opencodeopencode/index.tsopencode/v1.tspluginconfig)opencode/v2.tspluginsconfig)opencode/skills.tsgray-matter)opencode/skills/browse/SKILL.mdopencode/README.mdopencode/tsconfig.jsonUpdated files
README.md- Added OpenCode to "What's inside" table and Quick startdocs/add-a-plugin.md- Added OpenCode section with CI publishing and first-time setupCI Publishing Workflow
.github/workflows/publish-opencode.ymlpublishes to npm automatically:Triggers:
mainwhenopencode/package.jsonchangesworkflow_dispatch(with optional force flag)Features:
id-token: write) — noNPM_TOKENsecret required--provenanceflag for npm provenance attestationPackage features
The
@browserbasehq/opencodepackage:pluginarray) and OpenCode 2 (pluginsarray)skills/browse/SKILL.md)BROWSERBASE_API_KEYandBROWSERBASE_PROJECT_IDinto shell envopencode-pluginkeyword for discoverygray-matterfor robust YAML frontmatter parsingInstallation
OpenCode 2
Or in
opencode.jsonc:{ "plugins": ["@browserbasehq/opencode"] }OpenCode 1
In
opencode.json:{ "plugin": ["@browserbasehq/opencode"] }Then install the CLI:
E2E testing on cloud VM
Tools installed
opencode-ai@1.19.5)browse@0.11.3)Plugin installation test
CI validation
One-time setup after merge (requires @browserbasehq npm org access)
Before CI can publish, someone with access to the
@browserbasehqnpm organization must configure trusted publishing:Option A: Let CI create the package (recommended)
browserbase/browse-pluginpublish-opencode.ymlworkflow_dispatchOption B: Manual first publish
cd opencode && npm publish --access publicWhat still needs action
packages/web/src/content/docs/ecosystem.mdx:References
Note
Low Risk
Changes are additive (new package, workflow, and docs) with no modifications to existing agent manifests or shared validation scripts.
Reviewed by Cursor Bugbot for commit db7d426. Bugbot is set up for automated code reviews on this repo. Configure here.