Skip to content

feat: add OpenCode plugin support (@browserbasehq/opencode) - #7

Merged
shrey150 merged 4 commits into
mainfrom
cursor/opencode-support-cc72
Nov 6, 2026
Merged

shrey150 merged 4 commits into
mainfrom
cursor/opencode-support-cc72

Conversation

@shrey150

@shrey150 shrey150 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

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:

  1. npm plugins via opencode plugin add <pkg> or plugins in opencode.json(c)
  2. Agent Skills via .opencode/skills/<name>/SKILL.md
  3. Ecosystem listing via PR to opencode.ai/docs/ecosystem

This PR implements channel #1 with bundled skills and CI publishing.

Changes

New files

File Purpose
.github/workflows/publish-opencode.yml npm OIDC trusted publishing workflow
opencode/package.json npm manifest for @browserbasehq/opencode
opencode/index.ts Main entrypoint, exports both v1 and v2 APIs
opencode/v1.ts OpenCode 1 plugin hooks (plugin config)
opencode/v2.ts OpenCode 2 plugin setup (plugins config)
opencode/skills.ts Bundled skills loader (uses gray-matter)
opencode/skills/browse/SKILL.md Copy of the shared browse skill
opencode/README.md Plugin-specific documentation
opencode/tsconfig.json TypeScript config for type checking

Updated files

  • README.md - Added OpenCode to "What's inside" table and Quick start
  • docs/add-a-plugin.md - Added OpenCode section with CI publishing and first-time setup

CI Publishing Workflow

.github/workflows/publish-opencode.yml publishes to npm automatically:

Triggers:

  • Push to main when opencode/package.json changes
  • Manual workflow_dispatch (with optional force flag)

Features:

  • OIDC trusted publishing (id-token: write) — no NPM_TOKEN secret required
  • Idempotent: skips if version already exists on npm
  • Runs type check before publishing
  • Uses --provenance flag for npm provenance attestation

Package features

The @browserbasehq/opencode package:

  • ✅ Supports both OpenCode 1 (plugin array) and OpenCode 2 (plugins array)
  • ✅ Bundles the browse CLI skill (same content as skills/browse/SKILL.md)
  • ✅ Injects BROWSERBASE_API_KEY and BROWSERBASE_PROJECT_ID into shell env
  • ✅ Works for local browsing without an API key
  • ✅ Includes opencode-plugin keyword for discovery
  • ✅ Type-checked with TypeScript
  • ✅ Uses gray-matter for robust YAML frontmatter parsing

Installation

OpenCode 2

opencode plugin add @browserbasehq/opencode

Or in opencode.jsonc:

{
  "plugins": ["@browserbasehq/opencode"]
}

OpenCode 1

In opencode.json:

{
  "plugin": ["@browserbasehq/opencode"]
}

Then install the CLI:

npm install -g browse

E2E testing on cloud VM

Tools installed

  • ✅ OpenCode CLI (opencode-ai@1.19.5)
  • ✅ Browse CLI (browse@0.11.3)
  • ✅ Chrome/Chromium available

Plugin installation test

$ opencode plugin /agent/repos/browse-plugin/opencode --force
┌  Install plugin /agent/repos/browse-plugin/opencode
◇  Plugin package ready
◇  Detected server target
◇  Plugin config updated
●  Added to /tmp/opencode-test/.opencode/opencode.json
◆  Installed /agent/repos/browse-plugin/opencode
●  Scope: local (/tmp/opencode-test/.opencode)
└  Done

CI validation

$ node scripts/validate-template.mjs
Validation passed.

One-time setup after merge (requires @browserbasehq npm org access)

Before CI can publish, someone with access to the @browserbasehq npm organization must configure trusted publishing:

Option A: Let CI create the package (recommended)

  1. Merge this PR
  2. CI runs and fails (package doesn't exist yet, but reserves the name)
  3. Go to npmjs.com/package/@browserbasehq/opencode → Settings → Publishing access
  4. Add trusted publisher:
    • Repository: browserbase/browse-plugin
    • Workflow: publish-opencode.yml
    • Environment: (leave blank)
  5. Trigger workflow again via workflow_dispatch

Option B: Manual first publish

  1. Clone repo, checkout main after merge
  2. cd opencode && npm publish --access public
  3. Go to npmjs.com package settings → Publishing access
  4. Add trusted publisher as above
  5. Future publishes happen automatically via CI

What still needs action

  1. Merge this PR
  2. One-time trusted publishing setup (see above)
  3. Ecosystem listing PR - After publishing, open a PR to anomalyco/opencode adding this row to packages/web/src/content/docs/ecosystem.mdx:
    | [@browserbasehq/opencode](https://github.com/browserbase/browse-plugin/tree/main/opencode) | Browser automation, navigation, screenshots, and interaction via the browse CLI |

References

Open in Web Open in Cursor 

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.

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>
@shrey150
shrey150 requested a review from a team as a code owner November 5, 2026 22:04
@socket-security

socket-security Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​opencode-ai/​plugin@​1.19.51001007097100
Addednpm/​gray-matter@​4.0.39910010075100
Addednpm/​@​opencode/​plugin@​2.2.5991007996100
Addednpm/​@​types/​node@​22.20.51001008195100
Addednpm/​typescript@​5.9.31001009010090

View full report

@socket-security

socket-security Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

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.

Priority Alert  (click "▶" to expand/collapse) Action
Low priority
License policy violation: npm typescript

License: LicenseRef-W3C-Community-Final-Specification-Agreement - The applicable license policy does not permit this license (5) (package/ThirdPartyNoticeText.txt)

From: opencode/package.json → npm/typescript@5.9.3

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/typescript@5.9.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn

View full report

Comment thread docs/add-a-plugin.md Resolved
Comment thread opencode/skills.ts Resolved
cursoragent and others added 2 commits November 5, 2026 22:31
- 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>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread .github/workflows/publish-opencode.yml Resolved
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>
@shrey150
shrey150 merged commit 5a538bd into main Nov 6, 2026
5 checks passed
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.

3 participants