Overview
Browser Debugger CLI captures all console messages during your session, providing:
Smart error and warning prioritization
Automatic deduplication
Current page vs. history filtering
Object expansion for complex data
Real-time streaming
Console messages are captured automatically when you start a session.
Basic Usage
Smart Summary (Default)
The default behavior shows a smart summary of the current page:
Output:
Console Messages (current page)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ERRORS (2 unique, 5 total occurrences)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[×3] TypeError: Cannot read property 'map' of undefined
at app.js:245:12
[×2] Network error: Failed to fetch /api/users
at api.js:89:7
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WARNINGS (1)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Deprecated API called: getUserInfo()
at legacy.js:42:5
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
OTHER MESSAGES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
info: 12 messages
debug: 8 messages
By default, only messages from the current page load are shown. Use --history to see all messages from the session.
Filter by Page Load
Current Page Only (Default)
# Smart summary of current page
bdg console
Shows only messages from the most recent navigation. Ideal for debugging the current page state.
All Pages (History)
# Show messages from all page loads
bdg console --history
# Short form
bdg console -H
Includes messages from all navigations during the session. Useful for tracking issues across page transitions.
Filter by Level
Filter messages by their severity level:
# Errors only
bdg console --level error
# Warnings only
bdg console --level warning
# Info messages
bdg console --level info
# Debug messages
bdg console --level debug
Errors
Warnings
Info
Debug
bdg console --level error
Shows only error messages (console.error, uncaught exceptions) bdg console --level warning
Shows only warning messages (console.warn) Shows info messages (console.log, console.info) bdg console --level debug
Shows debug messages (console.debug, console.trace)
Chronological List
View all messages in chronological order:
# List all messages
bdg console --list
# Short form
bdg console -l
# Limit to last 50 messages
bdg console --list --last 50
Output:
[log] App initialized
[info] Loading user data...
[warn] Deprecated API called
[error] TypeError: Cannot read property 'map' of undefined
[debug] Request payload: {userId: 123}
[log] User data loaded
Limit Message Count
Control how many messages to display:
# Last 50 messages (default: 100)
bdg console --last 50
# All messages
bdg console --last 0
# Last 10 errors
bdg console --level error --last 10
Object Expansion
Console messages with objects are automatically expanded to show nested values:
Without expansion:
[log] User: [object Object]
With expansion:
Objects are expanded up to 3 levels deep. Large objects are truncated with … indicator.
Expanded Types
Objects: {key: value, nested: {inner: true}}
Arrays: [1, 2, 3] instead of Array(3)
Dates: Date(2025-03-05T12:00:00.000Z)
RegExp: /pattern/flags
Errors: Error: message at stack.js:10
Maps: Map(2) {key1 => value1, key2 => value2}
Sets: Set(3) {value1, value2, value3}
Real-Time Streaming
Stream console messages as they occur:
# Follow mode
bdg console --follow
# Short form
bdg console -f
# Follow errors only
bdg console --follow --level error
# Follow current page
bdg console --follow
# Follow all history
bdg console --follow --history
Press Ctrl+C to stop following and return to shell.
Combine Filters
Filters can be combined for precise results:
# Errors from current page, last 20
bdg console --level error --last 20
# All warnings from history
bdg console --level warning --history
# Last 10 info messages as list
bdg console --level info --list --last 10
# Follow errors from all pages
bdg console --follow --level error --history
Workflow Examples
Debug Application Errors
Check Smart Summary
Shows deduplicated errors with occurrence counts and source locations.
Get Full Error List
bdg console --level error --list
Chronological list of all errors.
Check Network Correlation
# Check if errors correlate with network failures
bdg network list --preset errors
Monitor Page Transitions
# Start with a page
bdg https://example.com/page1
# Navigate to another page (via UI)
# ...
# Check messages from all navigations
bdg console --history
# Compare current vs previous
bdg console # Current page only
bdg console --history # All pages
Track Deprecation Warnings
# List all warnings
bdg console --level warning
# Get full list with timestamps
bdg console --level warning --list --json | jq '.data.filtered[] | {timestamp, text}'
# Check if warnings repeat across pages
bdg console --level warning --history
JSON Output
All console commands support --json output:
bdg console --json
bdg console --list --json
bdg console --level error --json
JSON Structure
{
"version" : "0.5.1" ,
"success" : true ,
"data" : {
"messages" : [ ... ],
"filtered" : [ ... ],
"summary" : {
"total" : 45 ,
"errors" : 2 ,
"warnings" : 1 ,
"info" : 32 ,
"debug" : 10 ,
"uniqueErrors" : 2 ,
"currentPageOnly" : true
}
}
}
jq Integration
# Extract error messages
bdg console --json | jq -r '.data.filtered[] | select(.level == "error") | .text'
# Count by level
bdg console --json | jq '.data.filtered | group_by(.level) | map({level: .[0].level, count: length})'
# Find errors with stack traces
bdg console --json | jq '.data.filtered[] | select(.level == "error" and .stackTrace)'
# Get unique error messages
bdg console --json | jq -r '.data.filtered[] | select(.level == "error") | .text' | sort -u
# Export to file
bdg console --json > console.json
Understanding Console Types
Browser Debugger CLI maps Chrome console types to levels:
Chrome Type Level Description errorerror Errors and exceptions warnwarning Warnings loginfo console.log() infoinfo console.info() debugdebug console.debug() tracedebug console.trace() dirinfo console.dir() dirxmlinfo console.dirxml() tableinfo console.table() clearinfo console.clear() countinfo console.count() timeinfo console.time() timeEndinfo console.timeEnd() asserterror console.assert() failures
Tips and Best Practices
Quick Debugging
Multi-Page Apps
Real-Time Monitoring
Correlation
Start with the smart summary to see deduplicated errors and warnings: Then drill down with --list or --level as needed. Use --history to track issues across page navigations: bdg console --history --level error
Follow errors during development: bdg console --follow --level error
Combine with network debugging: bdg console --level error
bdg network list --preset errors
Next Steps
Network Monitoring Monitor and filter network requests
DOM Inspection Query and inspect page elements
API Reference Complete console command reference
Forms & Interaction Interact with forms and elements