chrome-cdp

Control a local Chrome session via the Chrome DevTools Protocol from the command line.

6|1|Updated Nov 23, 2023
One-click install
npx skills add https://github.com/gmcabrita/dotfiles --skill chrome-cdp-gmcabrita
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: chrome-cdp
Source: https://github.com/gmcabrita/dotfiles/tree/main/.agents/skills/chrome-cdp
Command: npx skills add https://github.com/gmcabrita/dotfiles --skill chrome-cdp-gmcabrita

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Developers need a lightweight, Puppeteer-free way to script and automate interactions with a local Chrome session using the Chrome DevTools Protocol.

Core Features & Use Cases

  • List open pages and targets, inspect page metadata, and manage per-tab sessions
  • Take viewport screenshots, evaluate JavaScript, navigate, and interact with elements across multiple tabs
  • Use the per-tab daemon to keep a persistent CDP connection and script complex workflows safely

Quick Start

Start by listing targets with cdp list, then capture a screenshot with cdp shot <target>.

Frequently Asked Questions about chrome-cdp

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I control a local Chrome session via the Chrome DevTools Protocol from the command line?▼

You can control a local Chrome session via the Chrome DevTools Protocol from the command line by using a lightweight per-tab daemon and CLI scripts to navigate pages, evaluate JavaScript, and take screenshots without needing Puppeteer.

Do I need Puppeteer to script Chrome automation and interact with elements across multiple tabs?▼

No, you do not need Puppeteer to script Chrome automation. This approach uses a lightweight per-tab daemon to maintain a persistent CDP connection, allowing you to interact with elements across multiple tabs directly from the CLI.

What is required to automate web interactions using the Chrome DevTools Protocol?▼

Automating web interactions using the Chrome DevTools Protocol requires a local Chrome session with remote debugging enabled and Node.js 22 or higher to run the CLI scripts and manage the per-tab daemon.

How do I list open pages and take viewport screenshots using CDP?▼

To list open pages and take viewport screenshots using CDP, you can run CLI commands to list available targets, then specify a target to capture a screenshot of its viewport.

Can I evaluate JavaScript and navigate pages across multiple tabs without a browser automation library?▼

Yes, you can evaluate JavaScript and navigate pages across multiple tabs without a browser automation library by sending commands directly through the Chrome DevTools Protocol using a lightweight CLI script.