bap watch
Long-running command that subscribes to browser events and streams them to the terminal. Runs until Ctrl+C.Usage
Comma-separated list of event types to show. Options:
page, console, network, dialog,
download. When omitted, all events are shown.Output format:
pretty (color-coded, human-readable) or json (NDJSON for piping).Event Types
page
page
Page lifecycle events: load, navigation, close.
console
console
Browser console output with log level (error, warn, log, debug).
14:30:43 CONSOLE ERROR Uncaught TypeError: Cannot read properties of null 14:30:43 CONSOLE WARN Deprecation: Feature X will be removed in v3network
network
HTTP requests and responses. Responses show status codes, color-coded by range.
dialog
dialog
Browser dialogs: alert, confirm, prompt.
14:30:44 DIALOG alert: Are you sure you want to leave?download
download
File downloads with state and filename.
JSON Output
With--format=json, each event is emitted as a single JSON line (NDJSON), suitable for piping to other tools:
Use Cases
Debug failing interactions
Run
bap watch --filter=console in one terminal while running BAP commands in another. Console
errors often explain why clicks or fills fail.Monitor API calls
Use
bap watch --filter=network to see what API calls a page makes. Useful for understanding
SPA behavior.Pipe to log aggregator
bap watch --format=json | jq '.text' to extract console message text, or pipe to any
NDJSON-compatible tool.Catch unexpected dialogs
Use
bap watch --filter=dialog to detect alert/confirm/prompt dialogs that might block
automation.bap watch requires a running browser session. If no session exists, start one first with bap open or bap goto.