by szymdzum
Let Claude Code and other coding agents drive and debug Chrome from the shell. DOM, network, console and raw CDP as short commands, no screenshots and no MCP needed.
# Add to your Claude Code skills
git clone https://github.com/szymdzum/browser-debugger-cliGuides for using ai agents skills like browser-debugger-cli.
browser-debugger-cli is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by szymdzum. Let Claude Code and other coding agents drive and debug Chrome from the shell. DOM, network, console and raw CDP as short commands, no screenshots and no MCP needed. It has 187 GitHub stars.
browser-debugger-cli's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/szymdzum/browser-debugger-cli" and add it to your Claude Code skills directory (see the Installation section above).
browser-debugger-cli is primarily written in TypeScript. It is open-source under szymdzum on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh browser-debugger-cli against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
Give your AI agent a real browser. And the DevTools to go with it.
📖 Wiki: Getting Started · Commands · For AI Agents · Recipes · Quick Reference · Troubleshooting · CLI reference
bdg keeps a browser session open in the background and lets you drive it one shell command at a time. Click, fill, navigate, then read what actually happened: requests, console errors, layout and styles. It is built for coding agents like Claude Code, Codex and Gemini CLI, and it's just as handy in your own terminal. Every command is a plain process with compact output, so it pipes into jq and costs an agent few tokens.
npm install -g browser-debugger-cli
bdg localhost:3000

The cart button does nothing, and the page doesn't say why. Three commands later the agent knows: the click fired a POST that returned 500, the console says the cart_id cookie is missing, and the cookie jar confirms it. Network, console, cookies and the DOM are there whenever the agent asks, without a debugger UI.

No Playwright script written up front. The agent runs one command, reads what the browser reports back, and picks the next step from that: the click says which text appeared, dom inspect says what the button looks like. When the page does something unexpected, the agent adapts on the spot instead of failing at line 40 of a test.
$ bdg network cookies
1 Cookie:
[0] tp_lax
Value: cookie-marker-493
Domain: localhost
Path: /
Expires: Session
HttpOnly: No
Secure: No
SameSite: Lax
$ bdg network headers 89565.2 --header authorization
Request Headers:
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZGEifQ.demo
$ bdg eval "localStorage.getItem('access_token')"
eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZGEifQ.demo
HttpOnly cookies are included, even though the page's own JavaScript can't read them. Log in once in the browser, then reuse the session from the shell:
COOKIES=$(bdg network cookies --json | jq -r '[.data[] | "\(.name)=\(.value)"] | join("; ")')
curl -H "Cookie: $COOKIES" localhost:3000/api/me
$ bdg dom a11y tree
[RootWebArea] "My App" (focused)
[Heading] "My App"
[Button] "Sign in" (focusable)
[Image] ← no accessible name
$ bdg cdp Performance.enable
$ bdg cdp Performance.getMetrics --json | jq '.data.result.metrics | from_entries'
{ "Nodes": 51, "LayoutDuration": 0.000115, "ScriptDuration": 0.000775, "JSHeapUsedSize": 772124, ... }
$ bdg cdp Emulation.setCPUThrottlingRate --params '{"rate":4}' # Slow CPU
$ bdg cdp Network.emulateNetworkConditions --params '{"offline":false,"latency":400,"downloadThroughput":50000,"uploadThroughput":20000}'
Accessibility, performance metrics, CPU profiling, heap snapshots, code coverage, throttling, storage, service workers: everything Chrome DevTools can do, bdg can do too, through raw CDP. Can't find the method you need? bdg cdp --search heap.
No docs to paste into the prompt. The agent asks bdg:
bdg --help --json # Every command, flag and exit code, plus "task → command" mappings
bdg dom query --help --json # One command in full: option behaviors, defaults, examples
bdg cdp --search cookie # 13 matching methods across all CDP domains, one line each
bdg cdp Network.getCookies --describe # Parameters, return types, an example call
And when it gets something wrong, bdg tells it what it meant:
$ bdg dom clik "a"
Error: unknown command 'clik'
Did you mean: click?
$ bdg cdp Network.getCookie
Error: Method 'Network.getCookie' not found
Use: bdg cdp --search <keyword> (to search for methods)
Did you mean:
- Network.getCookies
- Network.setCookie
- Network.setCookies
To send it as typed (a method newer than bdg's protocol): bdg cdp Network.getCookie --send-anyway
With --json the same hint is a suggestion field. Each mistake exits with code 81 (invalid arguments), so the agent knows to fix the call rather than retry it. CDP method names are case-insensitive, and raw CDP calls point to the friendlier command when one exists. More in the Agent-Friendly Tools principles bdg follows.
The one measurement bdg has is from bdg 0.6.x (November 2025): five debugging tasks done by an AI agent with bdg and with the official Chrome DevTools MCP server, written up in the full analysis. Both tools have changed since, and #428 tracks the re-run.
bdg ships an agent skill that teaches the workflow: start once, act, read what changed, inspect without screenshots, check network and console.
bdg install-skill # Claude Code (~/.claude/skills) + Codex, Gemini CLI, ... (~/.agents/skills)
bdg install-skill --claude # Claude Code only
Start a new agent session afterwards. In Claude Code the skill loads when a task needs a browser, or on demand with /bdg. Re-run bdg install-skill after upgrading bdg.
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.
| Area | Commands |
|---|---|
| Page | navigate, reload, back/forward, viewport, phone (--mobile) and color-scheme emulation |
| Interaction | click (double, right), fill (React-compatible, file inputs), hover, keys, forms, scroll, wait; shadow DOM and iframes included |
| Inspection | element styles with the CSS cascade, layout and visibility, page-wide audits (contrast, overflow, layers, animations, accessibility rules), stylesheet search, accessibility tree, event listeners, screenshots |
| Telemetry | network requests and headers (incl. Authorization), HAR export, cookies (incl. HttpOnly), console messages, live peek --follow |
| Accessibility | accessibility tree, semantic queries (role:button name:Submit), contrast checks |
| Performance | metrics, CPU and heap profiling, tracing, CPU and network throttling (raw CDP) |
| Sessions | several named sessions side by side, or attach to a browser you already have open (bdg attach lists its tabs and attaches to one without reloading it; --chrome-ws-url for a Chrome started with a debugging port) |
| Everything else | raw CDP: bdg cdp --list, --search, --describe |
The CLI reference documents every command. bdg --help --json gives agents the machine-readable version.
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 `-