| name | bdg-browser-debug |
| description | Browser debugging and telemetry via Chrome DevTools Protocol. Use when testing the Astro dev server, inspecting network requests, debugging console errors, capturing screenshots, or interacting with DOM elements on localhost:4321. |
| allowed-tools | Bash, Read |
bdg - Browser Debug Gateway
Browser telemetry via Chrome DevTools Protocol for testing the Astro dev server.
Quick Start
bdg http://localhost:4321/
bdg status
bdg peek
bdg stop
Session Management
| Command | Description |
|---|
bdg http://localhost:4321/ | Start session on dev server |
bdg status | Show session status |
bdg stop | Stop and save to ~/.bdg/session.json |
bdg stop --kill-chrome | Stop and close Chrome |
bdg cleanup | Clean stale sessions |
bdg cleanup --aggressive | Force kill all Chrome instances |
Data Inspection
Peek (non-destructive preview)
bdg peek
bdg peek -n
bdg peek -c
bdg peek -d
bdg peek -f
bdg peek --last 20
bdg peek -j
Network
bdg network list
bdg network list --failed
bdg network list --type XHR
bdg network headers
bdg network headers <id>
bdg network getCookies
bdg network har
Console
bdg console -l
bdg console --level error
bdg console --level warning
bdg console -f
bdg console --last 50
Details
bdg details request <id>
bdg details console <id>
DOM Interaction
Inspection
bdg dom a11y
bdg dom a11y "button"
bdg dom query "nav a"
bdg dom get "header"
bdg dom get "article" --raw
Actions
bdg dom click "button.submit"
bdg dom fill "input[name=email]" "test"
bdg dom submit "form"
bdg dom pressKey "input" "Enter"
bdg dom eval "document.title"
Screenshots
bdg dom screenshot ./shot.png
bdg dom screenshot ./el.png -s "header"
CDP Protocol Access
bdg cdp --list
bdg cdp --search cookie
bdg cdp --describe Network.getCookies
bdg cdp Network.getCookies
Common Workflows
Test page load performance
bdg http://localhost:4321/
bdg peek -n
bdg network list --failed
bdg stop
Debug console errors
bdg http://localhost:4321/
bdg console --level error
bdg console -f
Inspect accessibility
bdg http://localhost:4321/
bdg dom a11y
bdg dom a11y "navigation"
Capture visual state
bdg http://localhost:4321/
bdg dom screenshot ./screenshots/home.png
bdg dom screenshot ./screenshots/header.png -s "header"
Options Reference
| Flag | Description |
|---|
-q, --quiet | Minimal output for AI agents |
-j, --json | JSON output (most commands) |
--headless | No visible browser window |
-t, --timeout <s> | Auto-stop after N seconds |
-p, --port <n> | Chrome debug port (default: 9222) |
--debug | Verbose logging |
Output Files
- Session data:
~/.bdg/session.json
- Chrome profile:
~/.bdg/chrome-profile/