hubcap console - Capture browser console messages
When to use
Capture console messages from the browser in real time, including log, warn, error, info, and debug levels. Use errors if you only need JavaScript exceptions with stack traces.
Usage
hubcap console [--duration <duration>] Arguments
None.
Flags
| Flag | Type | Default | Description |
|---|---|---|---|
--duration | duration | 0 | How long to capture; 0 = until interrupted |
Output
NDJSON stream written to stdout. Each line is a JSON object representing a console message.
| Field | Type | Description |
|---|---|---|
type | string | Console level: "log", "warn", "error", "info", or "debug" |
text | string | The console message text |
{"type":"log","text":"Page loaded successfully"} {"type":"warn","text":"Deprecated API usage detected"} {"type":"error","text":"Failed to fetch resource"} Errors
| Condition | Exit code | Stderr |
|---|---|---|
| Chrome not connected | 2 | error: connecting to Chrome: ... |
| Timeout | 3 | error: timeout |
Examples
Stream all console messages until Ctrl-C:
hubcap console Capture console output for 15 seconds:
hubcap console --duration 15s Filter for errors and warnings only:
hubcap console | jq 'select(.type == "error" or .type == "warn")' Navigate to a page and capture its console output:
hubcap goto --wait "https://example.com" && hubcap console --duration 10s | jq -r '.text'