| name | chrome-devtools-cli-usage |
| description | Complete guide for Chrome DevTools CLI - browser automation, debugging, performance analysis, network inspection. Use when automating Chrome, taking screenshots, analyzing performance, monitoring network/console, device emulation, or user mentions chrome-devtools, browser automation, puppeteer, debugging, performance testing, screenshot, network monitoring, console monitoring, or 크롬 개발자도구, 브라우저 자동화, 디버깅, 성능 분석. |
| allowed-tools | Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion |
| version | 1.0.0 |
| lastUpdated | "2025-11-08T00:00:00.000Z" |
Chrome DevTools CLI Usage Guide
chrome-devtools-cli provides command-line control of Chrome browsers for automation, debugging, and performance analysis. Perfect for developers, scripts, and CI/CD pipelines.
Quick Installation
brew install pleaseai/tap/chrome-devtools-cli
curl -fsSL https://raw.githubusercontent.com/pleaseai/chrome-devtools-cli/main/install.sh | bash
npm install -g @pleaseai/chrome-devtools-cli
Detailed installation: See references/INSTALLATION.md
Quick Start
Basic Navigation
chrome-devtools nav new-page --url https://example.com
chrome-devtools nav navigate --url https://google.com
chrome-devtools nav list-pages
Screenshots
chrome-devtools debug screenshot --path screenshot.png
chrome-devtools debug screenshot --path screenshot.png --full-page
Performance Analysis
chrome-devtools perf analyze --url https://example.com --format json
Network Monitoring
chrome-devtools network start-monitoring
chrome-devtools network list-requests --format toon
Essential Commands
Input Automation
chrome-devtools input click --uid <element-uid>
chrome-devtools input fill --uid input-email --value "user@example.com"
chrome-devtools input press-key --key Enter
chrome-devtools input handle-dialog --action accept
Page Navigation
chrome-devtools nav new-page --url <url>
chrome-devtools nav wait-for --selector "#element"
chrome-devtools nav wait-for --text "Welcome"
Device Emulation
chrome-devtools emulate device --name "iPhone 13"
chrome-devtools emulate resize --width 1920 --height 1080
Debugging
chrome-devtools debug start-console-monitoring
chrome-devtools debug list-console --types error,warning
chrome-devtools debug evaluate --script "document.title"
chrome-devtools debug screenshot --path screenshot.png --full-page
Performance
chrome-devtools perf start-trace
chrome-devtools perf stop-trace --output trace.json
chrome-devtools perf analyze --url <url> --duration 10000 --format json
Network
chrome-devtools network start-monitoring
chrome-devtools network list-requests --format toon
chrome-devtools network get-request --id <request-id>
chrome-devtools network clear
Global Options
Available on all commands:
chrome-devtools [options] <command> [command-options]
Connection:
--browser-url <url> - Connect to existing Chrome instance
--ws-endpoint <endpoint> - WebSocket endpoint
Browser:
--headless - Run without GUI
--isolated - Temporary profile
--channel <channel> - Chrome channel (stable, beta, dev, canary)
Output:
--format <format> - json, toon, or text (default)
Display:
--viewport <size> - Initial viewport (e.g., 1280x720)
Complete options: See references/COMMANDS.md
Output Formats
Text (Default)
Human-readable console output.
JSON
Standard JSON for programmatic use.
TOON (Token-Optimized)
58.9% token reduction vs JSON - ideal for LLM workflows.
chrome-devtools network list-requests --format toon
Common Workflows
Complete Automation
chrome-devtools debug start-console-monitoring
chrome-devtools network start-monitoring
chrome-devtools nav new-page --url https://example.com
chrome-devtools input fill --uid input-email --value "user@example.com"
chrome-devtools input click --uid button-submit
chrome-devtools debug screenshot --path result.png
chrome-devtools network list-requests --format toon
chrome-devtools close
CI/CD Integration
#!/bin/bash
chrome-devtools --headless nav new-page --url https://staging.example.com
chrome-devtools --headless debug screenshot --path ci-screenshot.png
chrome-devtools --headless perf analyze --url https://staging.example.com --format json > perf.json
chrome-devtools close
Mobile Testing
chrome-devtools emulate device --name "iPhone 13"
chrome-devtools nav new-page --url https://example.com
chrome-devtools debug screenshot --path mobile-iphone.png
chrome-devtools emulate device --name "iPad Pro"
chrome-devtools nav navigate --url https://example.com
chrome-devtools debug screenshot --path mobile-ipad.png
More workflows: See references/WORKFLOWS.md
Advanced Usage
Connect to Existing Chrome
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
--remote-debugging-port=9222 \
--user-data-dir=/tmp/chrome-profile
chrome-devtools --browser-url http://127.0.0.1:9222 nav list-pages
Headless Mode
chrome-devtools --headless --viewport 1920x1080 nav new-page --url https://example.com
Programmatic API
import { closeBrowser, navigatePage, takeScreenshot } from '@pleaseai/chrome-devtools-cli'
await navigatePage({ url: 'https://example.com' })
await takeScreenshot({ path: 'screenshot.png', fullPage: true })
await closeBrowser()
Advanced features: See references/ADVANCED-USAGE.md
Key Features
- Input Automation - Click, hover, fill forms, keyboard, drag-drop
- Navigation - Multi-page management, URL navigation, wait conditions
- Emulation - Device emulation, viewport resizing
- Performance - Trace recording, performance analysis
- Network - Request monitoring and inspection
- Debugging - Console monitoring, JavaScript evaluation, screenshots
- Multiple Formats - JSON, TOON (58.9% token reduction), text
- Flexible Connection - Launch new or connect to existing Chrome
Requirements
- Node.js v20.19+ (LTS)
- Chrome stable version
- npm or Bun
Architecture
Built on Puppeteer with CLI framework and output formatting utilities.
Tips and Best Practices
- Use TOON format for LLM workflows (58.9% token reduction)
- Start monitoring before navigation to capture all requests
- Use headless mode for CI/CD pipelines
- Use isolated mode for reproducible tests
- Connect to existing Chrome for debugging live instances
Reference Documentation
Resources
Version: 1.0.0
Author: Minsu Lee (@amondnet)
License: MIT