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

@rezkam/browser-tools

v0.3.0

Published

Sandboxed, owner-token-protected Chrome automation for AI agents: control pages, record and review GIFs, capture HAR and raw CDP events, send CDP calls, and manage Chrome profiles.

Readme

@rezkam/browser-tools

Sandboxed, owner-token-protected Chrome automation for AI agents: launch a managed Chrome with a copied profile, navigate, evaluate page JavaScript, screenshot, and stop it safely, all without touching your main Chrome.

This package is the npm-installable form of the browser-tools skill in boring-but-good. The skill itself now drives this package's CLI, so there is one supported way to run Browser Tools whether you got here through the skill or through npm directly.

Install

Two independent installs, pick what you need:

The skill (for an agent that should discover and use Browser Tools as a skill):

npx skills add rezkam/boring-but-good --skill browser-tools

The package/CLI (what the skill depends on, and what any project can depend on directly):

npm install -g @rezkam/browser-tools

This installs a global browser-tools command (via the package's bin entry) and, for programmatic use, exports the browser control module. If you would rather not install it globally, run any command through npx @rezkam/browser-tools <subcommand> instead.

GIF recording and review also require ffmpeg and its ffprobe tool:

brew install ffmpeg

CLI

Each subcommand dispatches to the matching script unchanged; flags are the same as the underlying script.

browser-tools start --task <task> --headless      # launch, prints an owner token on first start
export BROWSER_TOOLS_OWNER_TOKEN="<owner token from start output>"
browser-tools status --port <reported port>        # report whether it's running
browser-tools nav https://example.com --port <reported port>
browser-tools eval 'document.title' --port <reported port>
browser-tools screenshot --full --port <reported port>
browser-tools record-gif start --output "$PWD/login_process.gif" --port <reported port>
# Perform the multi-step interaction.
browser-tools record-gif stop --port <reported port>
browser-tools review-gif "$PWD/login_process.gif"
browser-tools record-har start --output "$PWD/checkout_api_network.har" --preset api --port <reported port>
# Perform the browser interaction, then stop and extract a non-executable recipe.
browser-tools record-har stop --port <reported port>
browser-tools extract-har "$PWD/checkout_api_network.har"
browser-tools record-cdp start --output "$PWD/checkout_network_events.jsonl" --domain Network --event 'Network.*' --port <reported port>
browser-tools record-cdp stop --port <reported port>
browser-tools cdp call Runtime.evaluate --params '{"expression":"document.title"}' --port <reported port>
browser-tools pick "Click the price" --port <reported port>
browser-tools scrape-page --port <reported port>
browser-tools extract-article --chars 6000 --port <reported port>
browser-tools stop --clean --port <reported port>
browser-tools config task-profile set <task> --profile "<alias>"

Run browser-tools --help for the full command list.

Programmatic use

import { connectBrowser, activePage, withBrowser } from '@rezkam/browser-tools';

@rezkam/browser-tools and @rezkam/browser-tools/browser-control.mjs both resolve to the browser control module (launch, stop, profile sync, owner-token safety, CDP connect). @rezkam/browser-tools/resource-helper.mjs resolves to the shared generic-extractor lifecycle helper.

Behavior notes

  • Headless (--headless) runs full Chrome (--headless=new), not the legacy no-extensions engine, so profile, cookies, and extensions load the same as a windowed launch.
  • Profile Sync excludes the Google identity from a copied profile by default, so a clone cannot log your main Chrome out of Google; pass --include-google only for Google-backed workflows.
  • Every managed browser is owned by a token printed at start; stop refuses to kill a browser it does not own, another agent's browser, or your main Chrome.
  • GIF recording requires an explicit action-specific output name. start captures pre-action frames before returning, and stop captures post-action frames before finalizing the GIF.
  • review-gif probes frame count, duration, frame rate, and dimensions, then creates a sampled contact sheet and JSON report under the GIF's owner-only .gif-review/ directory.
  • record-har captures owner-protected filtered active-tab HTTP traffic as private HAR 1.2. extract-har derives a compact chronological recipe without executing requests. WebSocket handshakes and frames require record-cdp.
  • record-cdp writes selected raw protocol events as private JSONL. cdp call sends one owner-protected active-tab method while blocking known managed-lifecycle bypasses.
  • HAR, recipes, raw CDP events, and direct results preserve exact debugging evidence by default. Add --redact to filter sensitive-looking values. Capture files are owner-only 0600, not encrypted.
  • Config, cache, and artifact directories default to ~/.agents/browser-tools/config.json, ~/.cache/pi-browser-tools, and /tmp, overridable via BROWSER_TOOLS_CONFIG_DIR, BROWSER_TOOLS_CACHE_DIR, BROWSER_TOOLS_ARTIFACT_DIR, BROWSER_TOOLS_CHROME_SOURCE_DIR, and BROWSER_TOOLS_CHROME_BIN.
  • Requires macOS Chrome and Node.js 20+. GIF recording and review require ffmpeg and ffprobe.

For the full behavior reference (profile sync internals, ownership rules, stop safety checks, gotchas), see the skill docs in the source repository: SKILL.md and references/browser-control.md.

Testing

npm test             # Fast unit and CLI contract tests
npm run test:e2e     # Real headless Chrome and ffmpeg GIF interaction test
npm run validate     # Both suites

The E2E tests use real Chrome, ffmpeg, and ffprobe against local isolated fixtures. GIF tests validate recording, private output, and contact-sheet review. Network tests validate raw filtered HAR capture, optional recipe redaction, raw wildcard CDP events, direct CDP calls, owner-token refusal, private file modes, hard event limits, and lifecycle-method blocking. They do not use a live account or external server.

License

Apache-2.0