@m64/browser-tools
v1.0.4
Published
Minimal CDP tools for collaborative site exploration
Maintainers
Readme
browser-tools
Browser automation helpers for Pi using the Chrome DevTools Protocol.
This skill provides small scripts for starting a browser, navigating pages, evaluating JavaScript, taking screenshots, inspecting cookies, extracting content, and interactively picking elements.
Originally created by Mario Zechner. Linux support, npm packaging, and publication by m64.
Files
SKILL.md— skill instructions for the agentbrowser-start.js— start Chrome/Chromium with remote debugging on:9222browser-nav.js— navigate the active tab or open a new tabbrowser-eval.js— run JavaScript in the active tabbrowser-screenshot.js— capture a screenshot of the current pagebrowser-pick.js— interactive DOM element pickerbrowser-cookies.js— inspect cookies for the current tabbrowser-content.js— extract readable page content as markdown
Install
Install as a Pi skill package
From npm:
pi install npm:@m64/browser-toolsFrom a local checkout:
pi install /absolute/path/to/browser-tools
# or
pi install ./browser-toolsThis package now declares itself as a Pi package in package.json via the pi manifest and the pi-package keyword, so Pi can discover and load the browser-tools skill automatically.
Install the standalone CLI tools
If you only want the command-line tools outside Pi:
npm install -g @m64/browser-toolsFrom source:
cd /path/to/browser-tools
npm installUsage
Start a browser:
browser-start
# or from source:
./browser-start.jsNavigate:
browser-nav https://example.com
# or from source:
./browser-nav.js https://example.comEvaluate JavaScript:
browser-eval '({title: document.title, url: location.href})'
# or from source:
./browser-eval.js '({title: document.title, url: location.href})'Linux support
browser-start.js supports Linux and macOS.
Behavior on Linux:
- auto-detects
google-chrome,google-chrome-stable,chromium, and Snap Chromium - uses headless mode automatically when no desktop display is available
- supports overriding the browser path with
CHROME_BIN
For Snap Chromium, the browser profile directory must live in the Snap-managed area, so the script uses:
~/snap/chromium/common/browser-toolsFor non-Snap browsers, it uses:
~/.cache/browser-toolsNotes
- Remote debugging port:
9222 --profilesupport inbrowser-start.jsis currently macOS-only- The npm package exposes CLI binaries like
browser-start,browser-nav, andbrowser-eval
