chrome-cdp
Installation
Summary
Lightweight Chrome DevTools Protocol CLI for inspecting and interacting with local browser tabs via WebSocket.
- Connects directly to Chrome/Chromium/Brave/Edge with remote debugging enabled; no Puppeteer dependency, supports 100+ tabs with instant connection
- Core commands:
listtabs,shot(viewport screenshots),snap(accessibility tree),eval(JavaScript),click/clickxy(interactions),type(text input),nav(navigation),html(DOM extraction),net(resource timing) - Handles coordinate conversion between native image pixels and CSS pixels via device pixel ratio (DPR);
clickxytakes CSS pixel coordinates - Requires Node.js 22+, Chrome with remote debugging enabled via
chrome://inspect/#remote-debugging, and optionalCDP_PORT_FILEenv var for non-standard DevToolsActivePort locations - Background daemon persists sessions for 20 minutes, eliminating repeated "Allow debugging" prompts after first tab access
SKILL.md
Chrome CDP
Lightweight Chrome DevTools Protocol CLI. Connects directly via WebSocket — no Puppeteer, works with 100+ tabs, instant connection.
Prerequisites
- Chrome (or Chromium, Brave, Edge, Vivaldi) with remote debugging enabled: open
chrome://inspect/#remote-debuggingand toggle the switch - Node.js 22+ (uses built-in WebSocket)
- If your browser's
DevToolsActivePortis in a non-standard location, setCDP_PORT_FILEto its full path
Commands
All commands use scripts/cdp.mjs. The <target> is a unique targetId prefix from list; copy the full prefix shown in the list output (for example 6BE827FA). The CLI rejects ambiguous prefixes.
List open pages
scripts/cdp.mjs list