Skip to main content
Browser Debugger CLI

Browser Debugger CLI

Chrome DevTools Protocol in your terminal. Opens a persistent connection to Chrome where commands can be executed sequentially via Unix pipes. Designed for AI agents and developers who want direct browser control without framework overhead.

Why bdg?

Raw CDP Access

All 644 protocol methods available directly. No abstractions, no limitations.

Token Efficient

No overhead from MCP tool definitions. Progressive discovery loads only what’s needed.

Self-Correcting

Errors clearly exposed with semantic exit codes and suggestions for recovery.

Composable

Unix philosophy: pipes, jq, and shell scripts work naturally.

When to use alternatives

Use for complex multi-step scripts and mature testing ecosystems with built-in assertions and retry logic.
Use if you’re already invested in MCP infrastructure and need tight integration with existing MCP servers.

Built for AI Agents

Browser Debugger CLI is optimized for programmatic use by AI agents:
  • Self-discovery--list, --search, and --describe flags expose capabilities without documentation
  • Semantic exit codes — 0-119 range with specific meanings for error handling
  • Structured errors — JSON output with suggestions for recovery
  • Case-insensitive commands — Handles typos and variations gracefully
  • Token-efficient output — Minimal noise, maximum signal
Read more about agent-friendly design principles in the For AI Agents section.

Key Features

DOM Inspection

Query elements with CSS selectors and accessibility tree

Network Monitoring

Track requests, export HAR files, inspect headers

Console Debugging

Capture console messages with full argument inspection

Forms & Interaction

Fill forms, click buttons, submit data programmatically

Screenshots

Capture full-page or element screenshots

CDP Commands

Execute any of the 644 Chrome DevTools Protocol methods

Quick Example

# Start a session
bdg example.com

# Query DOM elements
bdg dom query "button"

# Execute CDP methods
bdg cdp Network.getCookies

# Monitor network traffic
bdg peek --network

# Stop session
bdg stop

Platform Support

  • ✅ macOS and Linux
  • ✅ Windows via WSL
  • ❌ PowerShell/Git Bash (not yet)

Next Steps

Installation

Install bdg via npm and get started

Quickstart

Start your first session in 60 seconds

Command Reference

Explore all available commands

For AI Agents

Learn about agent-optimized features

Build docs developers (and LLMs) love