npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

opencode-chrome-devtools

v1.0.4

Published

Browser automation plugin for OpenCode using direct Chrome DevTools Protocol connections.

Readme

OpenCode Chrome DevTools

Browser automation plugin for OpenCode using direct Chrome DevTools Protocol (CDP) connections.

This package now mirrors the browser tool example from OpenWork: no Chrome extension, no native messaging host, no local broker, and no hidden singleton browser state. Each tool call explicitly receives a browser_url, and tools can target a specific tab/window with target_id.

Why this architecture

  • Direct CDP keeps the package small and predictable.
  • browser_url makes the browser endpoint explicit and portable.
  • target_id supports multiple tabs/windows without per-session ownership state.
  • The same tools work with Chrome, Chromium, Electron, and remote/proxied CDP endpoints.

Configure OpenCode

Install or link the package, then add it to opencode.json or opencode.jsonc:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["opencode-chrome-devtools"]
}

Start A Browser

Start Chrome or Chromium with remote debugging enabled:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222

Then use http://127.0.0.1:9222 as browser_url.

For Electron apps, pass the app's exposed CDP endpoint as browser_url.

CLI Debugging

The CLI can list tools and run a tool directly after bun run build:

npx opencode-chrome-devtools tools
npx opencode-chrome-devtools tool browser_list --args '{"browser_url":"http://127.0.0.1:9222"}'
npx opencode-chrome-devtools tool browser_snapshot --args '{"browser_url":"http://127.0.0.1:9222"}'

If you omit browser_url in CLI calls, OPENCODE_BROWSER_URL is used, then http://127.0.0.1:9222.

Available Tools

  • browser_list: list page targets on a CDP endpoint.
  • browser_navigate: navigate a target to a URL.
  • browser_snapshot: get an accessibility tree snapshot with [uid] markers.
  • browser_click: click an element by snapshot UID.
  • browser_fill: fill an input by snapshot UID.
  • browser_eval: evaluate JavaScript in the page.
  • browser_screenshot: capture a PNG screenshot and return its saved path.

Typical Flow

  1. Run browser_list with a browser_url.
  2. Choose a target_id, or omit it to use the first page target.
  3. Run browser_navigate if needed.
  4. Run browser_snapshot to get UIDs.
  5. Use browser_click or browser_fill with a UID from the latest snapshot.
  6. Confirm results with browser_snapshot or browser_eval.

Troubleshooting

  • If browser_list fails, confirm the browser was started with --remote-debugging-port and that /json/list is reachable.
  • If browser_click or browser_fill says no snapshot is cached, call browser_snapshot first with the same browser_url and target_id.
  • If a proxied CDP endpoint returns localhost WebSocket URLs, the plugin rewrites them to the proxy host.