| name | web-browser |
| description | Interact with web pages using Chrome DevTools Protocol. Launches a managed browser instance (Helium / Brave Nightly / Chrome) with an isolated profile and exposes nav, eval, screenshot, pick, and emulation helpers. Run scripts/start.js first. |
Web Browser Skill
Minimal CDP-based browser automation. Scripts live in scripts/ and run via
node. The skill manages its own browser instance with an isolated profile
cache — it never attaches to your live browser profile.
Adapted from mitsuhiko/agent-stuff with Helium + Brave Nightly support.
Start the browser
./scripts/start.js
./scripts/start.js --profile
./scripts/start.js --reset-profile
Launches the browser with remote debugging on :9222.
Profile cache layout
~/.cache/agent-web/browser/
fresh-profile/ # default (--no flag)
profile-copy/ # --profile mode
state.json # pid, port, mode, binary
Browser binary resolution
Default preference order (first match wins):
$WEB_BROWSER_PATH (if set + exists)
/Applications/Helium.app/Contents/MacOS/Helium
/Applications/Brave Browser Nightly.app/Contents/MacOS/Brave Browser Nightly
/Applications/Brave Browser.app/Contents/MacOS/Brave Browser
- Google Chrome / Chromium / Chrome Canary
Profile source resolution (--profile mode)
$WEB_BROWSER_PROFILE (if set + exists)
~/Library/Application Support/BraveSoftware/Brave-Browser-Nightly
~/Library/Application Support/BraveSoftware/Brave-Browser
~/Library/Application Support/Google/Chrome
Env vars
| Var | Default (nix) | Purpose |
|---|
WEB_BROWSER_PATH | /Applications/Helium.app/Contents/MacOS/Helium | Browser binary |
WEB_BROWSER_PROFILE | ~/Library/Application Support/BraveSoftware/Brave-Browser-Nightly | Source profile for --profile |
BROWSER_DEBUG_HOST | localhost | CDP host |
BROWSER_DEBUG_PORT | 9222 | CDP port |
DEBUG | unset | Set to 1 for verbose stderr |
WEB_BROWSER_PATH + WEB_BROWSER_PROFILE are set via home.sessionVariables
in home/common/programs/pi-coding-agent/default.nix. Override per-shell by
exporting before invoking the scripts.
Navigate
./scripts/nav.js https://example.com
./scripts/nav.js https://example.com --new
Evaluate JavaScript
./scripts/eval.js 'document.title'
./scripts/eval.js 'document.querySelectorAll("a").length'
Runs in async context. Prefer single quotes to avoid shell escaping.
Screenshot
./scripts/screenshot.js
./scripts/screenshot.js --full-page
./scripts/screenshot.js --device iphone-14
./scripts/screenshot.js --device pixel-7 --full-page
Writes to a temp file and prints the path.
Device emulation (persistent)
./scripts/emulate.js --list
./scripts/emulate.js iphone-14
./scripts/emulate.js pixel-7 --landscape
./scripts/emulate.js --reset
Sets an active emulation preference. nav.js, eval.js, pick.js,
dismiss-cookies.js, and screenshot.js automatically reapply it.
Pick elements
./scripts/pick.js "Click the submit button"
Interactive picker. Click to select, Cmd/Ctrl+Click for multi-select, Enter to
finish.
Dismiss cookie dialogs
./scripts/dismiss-cookies.js
./scripts/dismiss-cookies.js --reject
Common chain:
./scripts/nav.js https://example.com && ./scripts/dismiss-cookies.js
Logs (console + errors + network)
start.js automatically spawns watch.js which writes JSONL to:
~/.cache/agent-web/logs/YYYY-MM-DD/<targetId>.jsonl
Tail:
./scripts/logs-tail.js
./scripts/logs-tail.js --follow
Summarize network responses:
./scripts/net-summary.js
Quick mobile debug flow
./scripts/start.js
./scripts/nav.js https://example.com
./scripts/emulate.js iphone-14
./scripts/nav.js https://example.com
./scripts/dismiss-cookies.js
./scripts/screenshot.js --full-page
Runtime dependencies
Scripts require the ws npm module (declared in scripts/package.json).
The scripts/ directory is built as a buildNpmPackage derivation in
home/common/programs/pi-coding-agent/default.nix (search for
webBrowserScripts), so node_modules/ws is baked into the symlinked
output and resolves automatically at runtime.
To bump the ws version: edit scripts/package.json, run
npm install --package-lock-only inside scripts/, then just home (the
npmDepsHash fake-hash workflow will reveal the new sha256).
Migration notes (vs old agent-browser CLI)
The previous version of this skill required browser connect 9222 against a
user-launched browser. The new version owns the browser lifecycle and uses
an isolated profile — your daily browser stays untouched. No connect step.