Skip to main content

Overview

Continuously monitor session data with automatic updates. Similar to Unix tail -f, this command refreshes the display at regular intervals to show the latest network requests and console messages.

Syntax

bdg tail [options]

Options

--last
number
default:"10"
Number of items to display. Valid range: 1-1000.
bdg tail --last 25
--interval
number
default:"1000"
Update interval in milliseconds. Valid range: 100-60000 (0.1s to 60s).
bdg tail --interval 2000  # Update every 2 seconds
bdg tail --interval 500   # Update twice per second
--network
boolean
default:"false"
Show only network requests.
bdg tail --network
--console
boolean
default:"false"
Show only console messages.
bdg tail --console
--verbose
boolean
default:"false"
Use verbose output with full URLs and formatting.
bdg tail --verbose
bdg tail -v
--json
boolean
default:"false"
Output as JSON instead of human-readable format.
bdg tail --json
JSON mode outputs the same format as bdg peek --json but updates continuously.

Output Format

Human-Readable (Default)

The display refreshes automatically, clearing the screen with each update: Compact format (default):
NETWORK (5)
  DOC  200  https://example.com/
  XHR  200  /api/users
  XHR  200  /api/posts
  SCR  200  /bundle.js
  CSS  200  /styles.css

CONSOLE (3)
  [log]    Application started
  [log]    User logged in
  [warn]   Deprecated API usage

Viewed at: 2025-11-06T12:00:05.123Z

Following preview... Press Ctrl+C to stop
Verbose format (--verbose):
NETWORK REQUESTS (5)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  [Document]     200  https://example.com/
  [XHR]          200  https://example.com/api/users
  [XHR]          200  https://example.com/api/posts
  [Script]       200  https://example.com/bundle.js
  [Stylesheet]   200  https://example.com/styles.css

CONSOLE MESSAGES (3)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  [log]    Application started
  [log]    User logged in
  [warn]   Deprecated API usage

Viewed at: 2025-11-06T12:00:05.123Z

Following preview... Press Ctrl+C to stop

JSON Format

Outputs the same JSON structure as bdg peek, refreshing at the specified interval:
{
  "version": "0.5.1",
  "success": true,
  "timestamp": "2025-11-06T12:00:00.000Z",
  "duration": 45230,
  "target": {
    "url": "http://localhost:3000",
    "title": "Example Page"
  },
  "data": {
    "preview": {
      "data": {
        "network": [...],
        "console": [...]
      }
    }
  }
}

Examples

Basic Usage

Start monitoring with defaults (last 10 items, update every second):
bdg tail
Show last 50 items:
bdg tail --last 50
Update every 2 seconds:
bdg tail --interval 2000

Filter by Data Type

Monitor only network traffic:
bdg tail --network
Monitor only console output:
bdg tail --console

High-Frequency Updates

Update twice per second (500ms interval):
bdg tail --interval 500
Fast updates with more items:
bdg tail --interval 250 --last 100

Verbose Monitoring

Watch with full details:
bdg tail --verbose
Verbose network monitoring:
bdg tail --verbose --network --last 25

JSON Streaming

Stream JSON output for processing:
bdg tail --json
Stream with custom interval:
bdg tail --json --interval 5000  # Update every 5 seconds

Behavior

Auto-Refresh

  • Screen clears before each update
  • Timestamp shows when the data was last refreshed
  • Updates continue until interrupted with Ctrl+C

Error Handling

If the daemon connection is lost during monitoring: Follow mode (default):
  • Retries connection automatically
  • Continues retrying until successful or interrupted
  • Uses the interval setting as retry delay
Interactive mode (--json not set):
  • Shows error message
  • Exits with appropriate exit code

Signal Handling

Graceful shutdown on Ctrl+C:
Following preview... Press Ctrl+C to stop
^C
Stopped following preview

Comparison with bdg peek --follow

Both commands provide continuous monitoring, with subtle differences:
Featurebdg tailbdg peek --follow
Primary useDedicated monitoringPreview with optional follow
Interval control--interval flagFixed 1000ms
SemanticsUnix-style tailPeek with live updates
Resource type filter❌ Not available--type flag
DOM data❌ Not available--dom flag
Use bdg tail for simple continuous monitoring. Use bdg peek --follow when you need resource type filtering or DOM data.

Exit Codes

0
SUCCESS
Command completed successfully (user interrupted with Ctrl+C).
81
INVALID_ARGUMENTS
Invalid option value.Common causes:
  • --last value outside range 1-1000
  • --interval value outside range 100-60000
83
RESOURCE_NOT_FOUND
No active session found.Solution: Start a session first with bdg <url>
101
CDP_CONNECTION_FAILURE
Cannot connect to daemon (in non-follow scenarios).Solution: Check session status with bdg status

Tips

Use --interval 250 for high-frequency monitoring during rapid page interactions.
Combine with --verbose to see full URLs and resource types during development: bdg tail --verbose --interval 2000
Low interval values (< 500ms) may cause screen flicker. Use the minimum interval that meets your monitoring needs.

Build docs developers (and LLMs) love