bdg (Browser Debugger CLI)

by szymdzum - A CLI and Claude Code skill for UI debugging in Chrome using the DevTools Protocol, including DOM inspection, browser events, rendered styles, and detailed layout information.

Setup guide

Quick start

bdg example.com                              # Start a session (the browser stays open)
bdg dom fill 'input[name="q"]' "shoes"       # Interact
bdg dom click 'button:has-text("Search")'
bdg dom wait "#result" --visible             # Wait for an element instead of sleeping
bdg network list --preset errors             # Failed requests
bdg console                                  # Console messages
bdg dom layout "#save"                       # Where is it? Visible? Covered?
bdg dom inspect "#save" --why color          # Which CSS rule sets the color
bdg dom audit contrast                       # Page-wide: text below WCAG AA, weakest first
bdg css search -- --brand                    # Where a token is set, in every stylesheet
bdg dom listeners "#save"                    # Which event listeners run
bdg page emulate --viewport 900x700          # Responsive check mid-session (--mobile for a phone)
bdg eval "document.title"                    # Run JavaScript (--frame for iframes)
bdg cdp Network.getCookies                   # Any CDP method
bdg stop                                     # End the session

Local dev servers with self-signed certificates: bdg https://localhost:5173 --chrome-flags="--ignore-certificate-errors". Need parallel sessions? bdg example.com --session agent2.

Install

Requirements: Node.js 22.12+ and a Chromium-based browser: Chrome, Chromium or Microsoft Edge.

Platforms: macOS, Linux and Windows via WSL. Native PowerShell and Git Bash are not supported yet.

Browsers: bdg launches Chrome by default. To use Edge, point CHROME_PATH at its binary, or attach to an Edge you started with --remote-debugging-port:

CHROME_PATH="/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge" bdg example.com   # macOS
CHROME_PATH=/usr/bin/microsoft-edge bdg example.com                                         # Linux
bdg example.com --chrome-ws-url 9222                                                        # Open a URL in a running browser

Your everyday Chrome: enable remote debugging at chrome://inspect/#remote-debugging, then bdg attach lists its tabs and bdg attach checkout starts a session on one as it is (no reload; Chrome asks you to allow each connection). --user-data-dir <dir> picks another profile (Canary, Edge, Brave).

Firefox and Safari are not supported: bdg speaks the Chrome DevTools Protocol, which they do not implement.

More in Browser

Browse nearby