CLI reference
Complete reference for the dbg CLI commands and flags.
Last updated March 19, 2026
CLI reference
The dbg CLI queries a running debugger session over IPC. It connects
to the dev server's log store via Unix sockets (macOS/Linux) or
Windows named pipes.
Usage
npx dbg <scope> <command> [flags]
npx dbg <command> [flags]
Scopes
browser
Query browser-side data. All browser commands filter entries where
source is browser.
| Command | Description |
|---|---|
npx dbg browser console |
Console logs (log, warn, error, debug, info) |
npx dbg browser errors |
Runtime errors and unhandled rejections |
npx dbg browser network |
Network requests (fetch, XHR, WebSocket) |
npx dbg browser cookies |
Document cookies |
npx dbg browser storage |
localStorage and sessionStorage |
npx dbg browser workers |
Service worker registrations |
npx dbg browser cache |
Cache Storage names and entry counts |
npx dbg browser permissions |
Browser permission states |
npx dbg browser quota |
Storage usage and quota |
server
Query server-side data. All server commands filter entries where
source is server.
| Command | Description |
|---|---|
npx dbg server console |
Server console logs |
npx dbg server errors |
SSR and runtime errors |
Top-level commands
| Command | Description |
|---|---|
npx dbg status |
Display session metadata (ID, framework, port, uptime) |
npx dbg all |
Display all entries merged by timestamp (default) |
npx dbg sessions |
List all active debugger sessions |
Flags
All flags are optional and can be combined with any command.
Output
| Flag | Description |
|---|---|
--json |
Output as JSON instead of formatted text |
--limit <n> |
Maximum number of entries to return (default: 50) |
Filtering
| Flag | Description |
|---|---|
--last <duration> |
Time window filter. Accepts 30s, 5m, 1h |
--level <level> |
Filter console entries by level (log, warn, error, debug, info) |
--status <code> |
Filter network entries by HTTP status code |
--failed |
Show only failed network requests |
Detail view
| Flag | Description |
|---|---|
--id <id> |
Show detail view for a single entry |
--ids <id1> <id2> |
Show detail view for multiple entries |
--headers |
Include request/response headers in network detail |
--body |
Include response body in network detail |
Application state filters
| Flag | Description |
|---|---|
--name <name> |
Filter cookies by name |
--key <key> |
Filter storage entries by key |
--type <type> |
Filter storage by type (local or session) |
Session targeting
| Flag | Description |
|---|---|
--port <port> |
Target a specific session by port number |
--session <id> |
Target a specific session by session ID |
Other
| Flag | Description |
|---|---|
--cwd <path> |
Override working directory for session discovery |
--help |
Display help text |
Examples
View the last 30 seconds of browser console warnings:
npx dbg browser console --level warn --last 30spnpm dlx dbg browser console --level warn --last 30sbun x dbg browser console --level warn --last 30syarn dlx dbg browser console --level warn --last 30sGet failed network requests as JSON:
npx dbg browser network --failed --jsonpnpm dlx dbg browser network --failed --jsonbun x dbg browser network --failed --jsonyarn dlx dbg browser network --failed --jsonInspect a specific network request with headers:
npx dbg browser network --id a1b2c3 --headers --bodypnpm dlx dbg browser network --id a1b2c3 --headers --bodybun x dbg browser network --id a1b2c3 --headers --bodyyarn dlx dbg browser network --id a1b2c3 --headers --bodyFind a specific cookie:
npx dbg browser cookies --name session_tokenpnpm dlx dbg browser cookies --name session_tokenbun x dbg browser cookies --name session_tokenyarn dlx dbg browser cookies --name session_tokenView only localStorage:
npx dbg browser storage --type localpnpm dlx dbg browser storage --type localbun x dbg browser storage --type localyarn dlx dbg browser storage --type localLook up a specific storage key:
npx dbg browser storage --key user_preferencespnpm dlx dbg browser storage --key user_preferencesbun x dbg browser storage --key user_preferencesyarn dlx dbg browser storage --key user_preferencesGet everything from the last 5 minutes as JSON:
npx dbg all --last 5m --jsonpnpm dlx dbg all --last 5m --jsonbun x dbg all --last 5m --jsonyarn dlx dbg all --last 5m --jsonMulti-session support
When you run multiple dev servers (for example, a frontend, an API, and a docs site), each one gets its own debugger session. You can list all active sessions and target a specific one by port or ID.
List active sessions
npx dbg sessionspnpm dlx dbg sessionsbun x dbg sessionsyarn dlx dbg sessions ID Framework Port PID Dir
────────────── ──────────── ─────── ──────── ────────────────────
dev-a1b2c3 vite 5173 12345 /project/apps/web
dev-d4e5f6 hono 3000 12346 /project/apps/api
dev-g7h8i9 fastapi 8000 12347 /project/apps/py-api
Target by port
npx dbg --port 3000 browser consolepnpm dlx dbg --port 3000 browser consolebun x dbg --port 3000 browser consoleyarn dlx dbg --port 3000 browser consolenpx dbg --port 5173 browser networkpnpm dlx dbg --port 5173 browser networkbun x dbg --port 5173 browser networkyarn dlx dbg --port 5173 browser networknpx dbg --port 8000 server consolepnpm dlx dbg --port 8000 server consolebun x dbg --port 8000 server consoleyarn dlx dbg --port 8000 server consoleTarget by session ID
npx dbg --session dev-a1b2c3 statuspnpm dlx dbg --session dev-a1b2c3 statusbun x dbg --session dev-a1b2c3 statusyarn dlx dbg --session dev-a1b2c3 statusnpx dbg --session dev-d4e5f6 browser errorspnpm dlx dbg --session dev-d4e5f6 browser errorsbun x dbg --session dev-d4e5f6 browser errorsyarn dlx dbg --session dev-d4e5f6 browser errorsDefault behavior
Without --port or --session, the CLI finds the active session
by walking parent directories from the current working directory:
- macOS/Linux: looks for
.debugger/bridge.sock - Windows: probes named pipes matching
\\.\pipe\debugger-<hash>where<hash>is derived from the directory path
If your dev server runs in a subdirectory, use --cwd to point
to it:
npx dbg status --cwd ./apps/webpnpm dlx dbg status --cwd ./apps/webbun x dbg status --cwd ./apps/webyarn dlx dbg status --cwd ./apps/webJSON output
When using --json, the CLI outputs structured JSON that AI agents
can parse directly:
npx dbg browser console --json --limit 5pnpm dlx dbg browser console --json --limit 5bun x dbg browser console --json --limit 5yarn dlx dbg browser console --json --limit 5[
{
"type": "console",
"level": "log",
"args": ["User clicked button"],
"timestamp": 1710000000000,
"source": "browser",
"browser": "Chrome",
"id": "a1b2c3"
}
]
The browser field identifies which browser generated the entry
(Chrome, Edge, Brave, Firefox, Safari, Arc, and 40+ others).



