-
Notifications
You must be signed in to change notification settings - Fork 3
Commands
Kumak edited this page Nov 22, 2025
·
3 revisions
Complete command reference for bdg.
bdg <url> # Start session with URL
bdg localhost:3000 # Local development
bdg https://example.com # Full URL
bdg example.com # Auto-adds http://Options:
| Flag | Description |
|---|---|
--port <n> |
Custom CDP port (default: 9222) |
--timeout <s> |
Auto-stop after seconds |
--headless |
Run Chrome headless |
--no-wait |
Don't wait for page load |
--user-data-dir <path> |
Custom Chrome profile |
--chrome-ws-url <url> |
Connect to existing Chrome |
--compact |
Compact JSON output |
--all |
Disable default filtering |
bdg status # Basic status
bdg status --verbose # Include Chrome diagnostics
bdg status --json # JSON outputbdg stop # Stop session
bdg stop --kill-chrome # Also kill Chromebdg cleanup # Remove stale files
bdg cleanup --force # Force even if active
bdg cleanup --aggressive # Kill all Chrome processes
bdg cleanup --all # Remove session.json too# List all domains
bdg cdp --list # 53 domains
# List methods in domain
bdg cdp Network --list # 39 methods
bdg cdp DOM --list
# Search by keyword
bdg cdp --search cookie # Find cookie-related methods
bdg cdp --search screenshot
# Describe method
bdg cdp Network.getCookies --describe
bdg cdp Page.captureScreenshot --describe# No parameters
bdg cdp Network.getCookies
bdg cdp DOM.getDocument
# With parameters
bdg cdp Runtime.evaluate --params '{"expression":"document.title","returnByValue":true}'
bdg cdp Page.navigate --params '{"url":"https://example.com"}'
# Pipe with jq
bdg cdp Network.getCookies | jq '.cookies[] | select(.httpOnly)'bdg dom query "button" # Find all buttons
bdg dom query ".error" # By class
bdg dom query "#app" # By ID
bdg dom query --json # JSON outputResults are cached with indices for quick access.
# Semantic output (default) - 70-99% token reduction
bdg dom get "button" # [Button] "Submit" (focusable)
bdg dom get "#search" # [Searchbox] "Search" (focusable)
bdg dom get 0 # By cached index
# Raw HTML output
bdg dom get "button" --raw # Full HTML
bdg dom get "button" --raw --all # All matches
bdg dom get "button" --raw --nth 2 # 2nd match
bdg dom get --raw --node-id 123 # By nodeIdSemantic vs Raw:
| Semantic (Default) | Raw (--raw) |
|
|---|---|---|
| Token Efficiency | 70-99% reduction | Full HTML |
| Use Case | AI agents, automation | Debugging |
| Format | [Role] "Name" (props) |
HTML with attributes |
# Fill inputs
bdg dom fill "#username" "admin"
bdg dom fill "input[type=password]" "secret"
bdg dom fill 0 "value" # By cached index
# Click elements
bdg dom click "#login-btn"
bdg dom click "button" --index 2 # 2nd button
bdg dom click 0 # By cached index
# Press keys
bdg dom pressKey "input" Enter
bdg dom pressKey "input" Tab
bdg dom pressKey "body" Escape
bdg dom pressKey "input" a --modifiers ctrl # Ctrl+A
# Submit forms
bdg dom submit "#login-form"
bdg dom submit "#form" --wait-navigationbdg dom screenshot output.png
bdg dom screenshot page.jpg --format jpeg
bdg dom screenshot visible.png --no-full-page
bdg dom screenshot hq.jpg --format jpeg --quality 100bdg dom eval "document.title"
bdg dom eval "window.location.href"
bdg dom eval "document.querySelectorAll('a').length"bdg dom a11y tree # First 50 nodes
bdg dom a11y tree --json # Full tree as JSONbdg dom a11y query role=button
bdg dom a11y query name="Submit"
bdg dom a11y query role=button,name="Submit"
bdg dom a11y query description="Click to submit"bdg dom a11y describe "button[type=submit]"
bdg dom a11y describe "#login-form"
bdg dom a11y describe 0 # By cached indexbdg network har # Default filename
bdg network har myfile.har # Custom filename
bdg network har --json # JSON metadatabdg network headers # Main page headers
bdg network headers <requestId> # Specific request
bdg network headers --header csp # Filter by header
bdg network headers --jsonbdg network getCookies
bdg network getCookies --url https://api.example.combdg peek # Last 10 items
bdg peek --last 50 # More items
bdg peek --network # Network only
bdg peek --console # Console only
bdg peek --type Document # By resource type
bdg peek --type XHR,Fetch # Multiple types
bdg peek --verbose # Full URLs
bdg peek --jsonResource Types: Document, Stylesheet, Image, Media, Font, Script, XHR, Fetch, WebSocket, Other
bdg tail # Live updates
bdg tail --network # Network only
bdg tail --interval 2000 # Custom intervalbdg details network <requestId> # Full request/response
bdg details console <index> # Console message detailsbdg console # Current page: errors/warnings deduplicated
bdg console --last 50 # Limit to last 50 messages
bdg console --json # JSON with summary statsDefault view shows messages from current page load only:
- Errors and warnings with deduplication and occurrence counts
- Source locations (file:line:col) from stack traces
- Summary counts for info/debug/other messages
bdg console --history # All page loads, not just current
bdg console --history --list # Full history chronologicallybdg console --list # All messages in order (current page)
bdg console --list --last 100 # Last 100 messagesbdg console --follow # Stream in real-time (like tail -f)bdg details console <index> # Full message details with stack trace{
"version": "0.6.0",
"success": true,
"timestamp": "2025-11-22T12:00:00.000Z",
"duration": 1234,
"target": {
"url": "http://localhost:3000",
"title": "App"
},
"data": {...}
}{
"success": false,
"error": "Error message"
}| Flag | Description |
|---|---|
--json |
JSON output |
--help |
Show help |
--version |
Show version |
--help --json |
Machine-readable help schema |