Skip to content

Direct WebSocket CLI that drives a live Chrome session for inspecting, scripting, and screenshotting open pages.

CCM score
72 of 100
skills.sh installs
2.2K
GitHub stars
3.3K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers listing open tabs, screenshots, accessibility snapshots, JavaScript evaluation, navigation, and clicks through scripts/cdp.mjs
  • Includes click, clickxy, type, loadall, net, and a raw evalraw passthrough for arbitrary CDP methods
  • Requires remote debugging enabled in Chrome and Node.js 22+; CDP_PORT_FILE can point to a non-standard DevToolsActivePort location
  • Designed for inspecting or interacting with pages already open in a local browser, with a background daemon that exits after 20 minutes idle

Install

$ npx -y skills add pasky/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/pasky/chrome-cdp-skill
Categories
Browser Automation & Scraping, Debugging