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

cdp-browser

v0.1.3

Published

CDP-based browser control CLI for coding agents

Readme

cdp-browser

cdp-browser is a lightweight Chrome DevTools Protocol (CDP) CLI for coding agents.

It provides simple terminal commands to control a browser tab without Puppeteer:

  • navigate tabs
  • run JavaScript
  • take screenshots
  • pick elements interactively
  • dismiss cookie banners
  • watch console + network logs

Acknowledgement

This package is based on the web-browser skill from: https://github.com/mitsuhiko/agent-stuff/tree/main/skills/web-browser

This implementation uses native WebSocket support (Node 22+/Bun), with no ws dependency.

Requirements

  • One runtime:
    • Node.js 22+ (for npm/npx usage), or
    • Bun (for bun/bunx usage)
  • Google Chrome / Chromium installed
  • CDP endpoint available on http://localhost:9222
    • cdp-browser start configures this automatically
    • if you launch the browser manually, pass --remote-debugging-port=9222
  • cdp-browser start supports:
    • macOS (app bundle paths)
    • Debian/Ubuntu-style Linux setups (google-chrome* / chromium* on PATH)
    • custom executable via --browser <path-or-name> (or CDP_BROWSER_BIN)
    • profile selection via --copy-profile [name] and CDP_BROWSER_PROFILE
    • base directory override via CDP_BROWSER_BASE_DIR

Usage patterns

Project dependency usage pattern (recommended for reproducibility)

Install as a project dependency, then run from your package manager.

npm

npm install cdp-browser
npm exec cdp-browser -- start
npm exec cdp-browser -- nav https://example.com --new
npm exec cdp-browser -- eval "document.title"
npm exec cdp-browser -- screenshot

bun

bun add cdp-browser
bun run cdp-browser start
bun run cdp-browser nav https://example.com --new
bun run cdp-browser eval "document.title"
bun run cdp-browser screenshot

Skill installation for project dependency pattern

Install exactly one skill file as .agents/skills/cdp-browser/SKILL.md.

npm variant (symlink from dependency):

mkdir -p .agents/skills/cdp-browser
ln -sf "$(pwd)/node_modules/cdp-browser/skills/project/npm/cdp-browser/SKILL.md" \
  ".agents/skills/cdp-browser/SKILL.md"

bun variant (symlink from dependency):

mkdir -p .agents/skills/cdp-browser
ln -sf "$(pwd)/node_modules/cdp-browser/skills/project/bun/cdp-browser/SKILL.md" \
  ".agents/skills/cdp-browser/SKILL.md"

Global usage pattern

Run the package directly without adding a dependency.

npx

npx -y cdp-browser start
npx -y cdp-browser nav https://example.com --new
npx -y cdp-browser eval "document.title"

Pin a version when needed:

npx -y [email protected] nav https://example.com

bunx

bunx cdp-browser start
bunx cdp-browser nav https://example.com --new
bunx cdp-browser eval "document.title"

Pin a version when needed:

bunx [email protected] nav https://example.com

Skill installation for global pattern

Install exactly one skill file as .agents/skills/cdp-browser/SKILL.md.

Option A: install with Skills CLI

npx -y skills add sids/cdp-browser/skills/global/npx/cdp-browser -g
# or
bunx skills add sids/cdp-browser/skills/global/bunx/cdp-browser -g

Option B: copy one of the global skill variants manually:

mkdir -p .agents/skills/cdp-browser
cp ./skills/global/npx/cdp-browser/SKILL.md .agents/skills/cdp-browser/SKILL.md
# or
cp ./skills/global/bunx/cdp-browser/SKILL.md .agents/skills/cdp-browser/SKILL.md

Commands

  • cdp-browser start [--fresh] [--copy-profile [name]] [--browser <path-or-name>]
    Start Chrome/Chromium with remote debugging on port 9222 and start background watch logging.
  • cdp-browser nav <url> [--new]
    Navigate current tab or open a new tab.
  • cdp-browser eval '<js expression>'
    Evaluate JavaScript in the active tab.
  • cdp-browser screenshot
    Capture current viewport and print output PNG path.
  • cdp-browser pick '<message>'
    Interactive element picker with metadata output.
  • cdp-browser dismiss-cookies [--reject]
    Try to accept/reject cookie banners across common CMP implementations.
  • cdp-browser watch
    Start background logger for console/network events.
  • cdp-browser logs-tail [--file <path>] [--follow]
    Tail latest watcher log file.
  • cdp-browser net-summary [--file <path>]
    Summarize network statuses and failures from logs.
  • cdp-browser wait-network-idle [--timeout <ms>] [--idle-time <ms>] [--max-inflight <count>]
    Wait until active tab requests stay at or below the in-flight threshold for the idle window.

start option behavior:

  • --fresh: clears the managed browser data directory before launching.
  • --copy-profile [name]: copies your local browser profile store into managed data before launch.
    • if name is omitted, profile defaults to CDP_BROWSER_PROFILE or Default.
  • CDP_BROWSER_PROFILE: sets the profile directory used for launch (for example Default, Profile 1).
  • CDP_BROWSER_BASE_DIR: overrides managed base directory for both browser data and watcher logs.

Managed defaults (macOS + Linux):

  • browser data: ${XDG_DATA_HOME:-~/.local/share}/cdp-browser/browser-data
  • watcher logs: ${XDG_STATE_HOME:-~/.local/state}/cdp-browser/logs/YYYY-MM-DD/*.jsonl

When CDP_BROWSER_BASE_DIR is set:

  • browser data: ${CDP_BROWSER_BASE_DIR}/browser-data
  • watcher logs: ${CDP_BROWSER_BASE_DIR}/logs/YYYY-MM-DD/*.jsonl

Examples:

  • npm exec cdp-browser -- start --fresh
  • npm exec cdp-browser -- start --copy-profile
  • npm exec cdp-browser -- start --copy-profile "Profile 1"
  • CDP_BROWSER_PROFILE="Profile 1" npm exec cdp-browser -- start --copy-profile
  • CDP_BROWSER_BASE_DIR=/tmp/cdp-browser npm exec cdp-browser -- start --fresh
  • CDP_BROWSER_BASE_DIR=/tmp/cdp-browser npm exec cdp-browser -- watch
  • npm exec cdp-browser -- wait-network-idle --timeout 45000 --idle-time 1500

Logs

Watcher output is written to:

${XDG_STATE_HOME:-~/.local/state}/cdp-browser/logs/YYYY-MM-DD/*.jsonl

Override with:

CDP_BROWSER_BASE_DIR=/custom/cdp-browser

Then logs are written under:

${CDP_BROWSER_BASE_DIR}/logs/YYYY-MM-DD/*.jsonl

Publish

npm run publish:npm

To verify package contents first:

npm run pack:dry-run