Skip to main content

Overview

The status command displays information about the active session including process IDs, runtime duration, collected data counts, and Chrome diagnostics.

Syntax

bdg status [options]

Options

--json
boolean
default:"false"
Output as JSON for programmatic use
bdg status --json
--verbose
boolean
default:"false"
Show detailed Chrome diagnostics (process info, CDP connection details)
bdg status --verbose

Examples

Basic Status

bdg status
Output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SESSION ACTIVE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Status:      Running
Duration:    2m 34s
Target:      https://example.com
Title:       Example Domain

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
COLLECTED DATA
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Network:     47 requests
Console:     12 messages
DOM:         Captured on session stop

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PROCESS INFO
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

BDG PID:     12345
Chrome PID:  12346
CDP Port:    9222

Verbose Status

bdg status --verbose
Additional output includes:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CHROME DIAGNOSTICS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

WebSocket:   ws://localhost:9222/devtools/page/ABC123...
Target ID:   ABC123-DEF456-GHI789
Page State:  loaded

JSON Output

bdg status --json
Output:
{
  "version": "0.5.1",
  "success": true,
  "data": {
    "active": true,
    "sessionPid": 12345,
    "chromePid": 12346,
    "port": 9222,
    "startTime": "2025-03-05T10:30:00.000Z",
    "duration": 154000,
    "targetId": "ABC123-DEF456-GHI789",
    "webSocketDebuggerUrl": "ws://localhost:9222/devtools/page/ABC123...",
    "activeTelemetry": ["dom", "network", "console"],
    "activity": {
      "network": 47,
      "console": 12
    },
    "pageState": {
      "url": "https://example.com",
      "title": "Example Domain",
      "loadState": "loaded"
    }
  }
}

No Active Session

bdg status
Output:
No active session.

Start a session with: bdg <url>
JSON Output:
{
  "version": "0.5.1",
  "success": true,
  "data": {
    "active": false,
    "activity": null,
    "pageState": null
  }
}

Status Fields

Session Info

  • Status: Session state (Running)
  • Duration: Time elapsed since session start (e.g., 2m 34s)
  • Target: Current page URL
  • Title: Current page title

Collected Data

  • Network: Number of network requests captured
  • Console: Number of console messages captured
  • DOM: Indicates DOM capture happens on session stop

Process Info

  • BDG PID: Browser Debugger daemon process ID
  • Chrome PID: Chrome browser process ID
  • CDP Port: Chrome DevTools Protocol debugging port

Chrome Diagnostics (Verbose)

  • WebSocket: CDP WebSocket connection URL
  • Target ID: Chrome target/page identifier
  • Page State: Page load state (loading, loaded, networkIdle)

Use Cases

Check Session Before Running Commands

# Verify session is active before querying
if bdg status --json | jq -e '.data.active' > /dev/null; then
  bdg dom query "button"
else
  echo "No active session. Starting one..."
  bdg example.com
fi

Monitor Collection Progress

# Watch collection stats in real-time
watch -n 2 'bdg status'

# Or with jq for specific fields
watch -n 2 'bdg status --json | jq ".data.activity"'

Get Process IDs for System Monitoring

# Extract Chrome PID for resource monitoring
CHROME_PID=$(bdg status --json | jq -r '.data.chromePid')
ps -p $CHROME_PID -o %cpu,%mem,vsz

# Kill Chrome manually if needed
kill $CHROME_PID

Debug Connection Issues

# Show full diagnostics for troubleshooting
bdg status --verbose

# Check CDP WebSocket connection
bdg status --json | jq -r '.data.webSocketDebuggerUrl'

Exit Codes

0
SUCCESS
Status retrieved successfully (even if no active session)
83
RESOURCE_NOT_FOUND
Daemon not running (stale session files cleaned up)
110
SOFTWARE_ERROR
Unexpected error while retrieving status
Exit code 0 doesn’t mean a session is active - check the active field in output. Exit code 83 means the daemon isn’t running (no session files found).

bdg start

Start a new browser session

bdg peek

Preview collected data in detail

bdg stop

Stop session and save data

bdg cleanup

Clean up stale session files

Tips

Automation: Use bdg status --json | jq -e '.data.active' to check if a session exists before running commands. Exit code 0 = active, 1 = no session.
Debugging: If bdg status shows no session but you expect one, run bdg cleanup --force to remove stale files, then start a fresh session.
Daemon Connection: If the daemon crashed but left session files, status will detect the stale PID and automatically clean it up.

Build docs developers (and LLMs) love