bdg console command provides intelligent console message inspection with automatic error/warning prioritization, deduplication, and object expansion.
Quick Start
Syntax
Default Behavior
By default,bdg console shows:
- Current page only - Messages from the most recent navigation
- Errors deduplicated - With occurrence count and source location
- Warnings listed - With source location
- Info/debug summary - Count only
- Objects expanded - Nested structure visible
Options
Filtering Options
Filter messages by level:
error, warning, info, or debugExamples:Show messages from all page loads, not just the current navigationShorthand: Useful when debugging multi-page flows or tracking issues across navigations.
-HExample:Display Options
List all messages chronologically without deduplicationShorthand: Shows every message in order with timestamps and full details.
-lExample:Show last N messages (0 = all)Range: 0-10000Examples:
Stream console messages in real-time (updates every second)Shorthand: Press
-fExample:Ctrl+C to stop streaming.Follow mode behavior:- Shows last 20 messages
- Updates every 1 second
- Clears screen on each update
- Respects
--leveland--historyfilters
Output JSON format with summary statisticsExample:Returns structured data including message counts by level.
Output Modes
Smart Summary (Default)
The default mode intelligently organizes messages:- Errors grouped by message and stack trace
- Occurrence counts for duplicate errors
- Source file and line numbers
- Warning details
- Summary counts for info/debug
Chronological List
View all messages in order:Real-Time Streaming
Monitor console messages as they arrive:- Watch for errors during testing
- Monitor API calls
- Track user interactions
- Debug timing issues
Object Expansion
Console messages containing objects are automatically expanded to show nested values: Without expansion:- Nested objects expanded up to 3 levels deep
- Arrays show actual contents:
[1, 2, 3]instead ofArray(3) - Large objects truncated with
…indicator - Special types formatted:
Date,RegExp,Error,Map,Set
Filtering by Level
Console messages are categorized into four levels:| Level | Description | CLI Flag |
|---|---|---|
error | JavaScript errors, failed assertions | --level error |
warning | Warnings, deprecations | --level warning |
info | Informational messages | --level info |
debug | Debug messages, verbose logging | --level debug |
Common Workflows
Debug Errors on Current Page
Monitor Real-Time Logging
Inspect Multi-Page Flow
Export Console Data
JSON Output Format
The--json flag returns structured data:
messages- All captured console messagesfiltered- Messages after applying filters (level, history)summary- Statistics about message counts
Examples with Real Output
View All Error Messages
Monitor API Calls
Check Console State
Navigation Context
Console messages are tracked per navigation (page load). Each time the page navigates to a new URL, thenavigationId increments.
Default behavior (current page only):
navigationId: N (most recent).
Include all navigations:
navigationId values.
Use case: Track errors across login flow
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 81 | Invalid arguments (invalid —last value, invalid —level) |
| 83 | No active session |
| 102 | Connection timeout |
Related Commands
bdg cdp Console.enable- Enable Console domain via CDPbdg peek --console- Quick preview of recent console messagesbdg details console <index>- Full details for a specific message
Tips
- Use
--listto see raw chronological output without smart grouping - Combine
--level error --followto monitor errors in real-time - Use
--jsonfor programmatic processing withjq - Use
--historywhen debugging multi-page flows - Object expansion works automatically - no need for manual serialization

