New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Command-line Chrome DevTools Protocol client that inspects and drives open Chrome tabs over WebSocket.

skills.sh installs
228
GitHub stars
4
last updated
Jun 3, 2026
View on GitHub

What it does

  • Covers listing tabs, screenshots, accessibility snapshots, JavaScript evaluation, navigation, clicks, and text entry through scripts/cdp.mjs
  • Targets are addressed by unique targetId prefixes from list, and the CLI rejects ambiguous prefixes
  • Requires remote debugging enabled in Chrome, Node.js 22+, and explicit user approval before inspecting or interacting with a page
  • Designed for debugging and interacting with pages already open in Chrome, including tabs spread across many windows

Install

$ npx -y skills add hanyu0001/chrome-cdp-skill --skill chrome-cdp -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

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-debugging and toggle the switch
  • Node.js 22+ (uses built-in WebSocket)
  • If your browser's DevToolsActivePort is in a non-standard location, set CDP_PORT_FILE to 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

Take a screenshot

scripts/cdp.mjs shot <target> [file]    # default: screenshot-<target>.png in runtime dir

Captures the viewport only. Scroll first with eval if you need content below the fold. Output includes the page's DPR and coordinate conversion hint (see Coordinates below).

Accessibility tree snapshot

scripts/cdp.mjs snap <target>

Evaluate JavaScript

scripts/cdp.mjs eval <target> <expr>

Details

Repository
github.com/hanyu0001/chrome-cdp-skill
Categories
Browser Automation & Scraping, Debugging
First seen
Jun 3, 2026