Protocol

NDJSON protocol specification for communication between the IPC bridge and CLI

Last updated March 19, 2026

debugger uses a line-delimited JSON (NDJSON) protocol for communication between the IPC bridge and the CLI. Each message is a single JSON object terminated by a newline. This protocol is language-agnostic — all four language packages implement it identically.

Entry types

Four entry types flow into the log store. Each type is a discriminated union member keyed by the type field.

Console entry

ConsoleEntry
PropertyTypeDefaultDescription
type"console"-Entry type discriminator
idstring-6-character hex ID, assigned by the store (optional on input)
level"log" \| "warn" \| "error" \| "debug" \| "info"-Console method that produced the entry
argsunknown[]-Serialized arguments passed to console
timestampnumber-Unix epoch in milliseconds
source"browser" \| "server"-Where the entry originated

Error entry

ErrorEntry
PropertyTypeDefaultDescription
type"error"-Entry type discriminator
idstring-6-character hex ID (optional on input)
messagestring-Error message
stackstring-Stack trace (optional)
timestampnumber-Unix epoch in milliseconds
source"browser" \| "server"-Where the error occurred
urlstring-Page URL, browser only (optional)
componentstring-Framework component name (optional)

Network entry

NetworkEntry
PropertyTypeDefaultDescription
type"network"-Entry type discriminator
idstring-6-character hex ID (optional on input)
urlstring-Request URL
methodstring-HTTP method or "WS" for WebSocket
statusnumber-HTTP status code
durationnumber-Round-trip time in milliseconds
timestampnumber-Unix epoch in milliseconds
failedboolean-Whether the request failed
source"browser"-Always "browser"
kind"fetch" \| "xhr" \| "ws"-Request API used (optional)
requestHeadersRecord<string, string>-Request headers (optional)
responseHeadersRecord<string, string>-Response headers (optional)
responseBodystring-Response body, capped at 4 KB (optional)
connectionIdstring-WebSocket connection ID (optional)
messageCountnumber-WebSocket message count (optional)
wsReadyStatenumber-WebSocket ready state (optional)

App entry

AppEntry
PropertyTypeDefaultDescription
type"app"-Entry type discriminator
idstring-6-character hex ID (optional on input)
timestampnumber-Unix epoch in milliseconds
source"browser"-Always "browser"
cookiesCookieInfo[]-Browser cookies (optional)
localStorageRecord<string, string>-Local storage key-value pairs (optional)
sessionStorageRecord<string, string>-Session storage key-value pairs (optional)
serviceWorkersServiceWorkerInfo[]-Registered service workers (optional)
cacheStorageCacheInfo[]-Cache storage entries (optional)
permissionsPermissionInfo[]-Browser permission states (optional)
storageEstimateobject-Storage usage and quota in bytes (optional)

Request format

The CLI sends a single request per connection. The command field determines which buffer to query, and filters narrow the results.

QueryRequest
PropertyTypeDefaultDescription
idstring-Unique request identifier
commandstring-One of: "console", "errors", "network", "app", "status", "all", "push"
filters.lastnumber-Time window in milliseconds
filters.levelstring-Console level filter
filters.statusnumber-HTTP status code filter
filters.failedboolean-Failed requests only
filters.limitnumber50Maximum entries to return
filters.source"browser" \| "server"-Source filter
filters.idstring-Single entry ID lookup
filters.idsstring[]-Multiple entry ID lookup
filters.subcommandstring-App subcommand (cookies, storage, etc.)
filters.namestring-Cookie name filter
filters.keystring-Storage key filter
filters.storageType"local" \| "session"-Storage type filter

Response format

QueryResponse
PropertyTypeDefaultDescription
idstring-Matches the request ID
okboolean-Whether the query succeeded
dataLogEntry[][]Array of matching entries
sessionSessionInfo-Session metadata (included with status)
errorstring-Error message if ok is false

Transport

Each CLI invocation opens a new socket connection, writes one NDJSON line (the request), reads one NDJSON line (the response), and closes the connection. There is no persistent connection or streaming.

Search Documentation

Search for pages and content