chrome-devtools-cli lets you control and inspect a live Chrome browser from the command line. It provides direct CLI access to the full power of Chrome DevTools for reliable automation, in-depth debugging, and performance analysis - perfect for developers, scripts, and CI/CD pipelines.
Inspired by Chrome DevTools MCP, this CLI tool provides similar browser automation capabilities with superior token efficiency (~58.9% reduction via TOON format) - ideal for LLM-powered automation workflows.
- 🎯 Input Automation: Click, hover, fill forms, drag-and-drop, keyboard input
- 🧭 Navigation: Multi-page management, URL navigation, wait conditions
- 📱 Emulation: Device emulation, viewport resizing
- ⚡ Performance: Trace recording, performance analysis
- 🌐 Network: Request monitoring, inspection
- 🐛 Debugging: Console monitoring, script evaluation, screenshots, snapshots
- 🎨 Multiple Output Formats: JSON, TOON, or human-readable text
- 🔧 Flexible Browser Connection: Launch new instances or connect to existing Chrome
# Add tap
brew tap pleaseai/tap
# Install
brew install chrome-devtools-cli
# Or one-liner
brew install pleaseai/tap/chrome-devtools-cliUpdate:
brew upgrade chrome-devtools-cliDownload pre-built binaries from GitHub Releases:
Auto-detects your platform and architecture:
curl -fsSL https://raw.githubusercontent.com/pleaseai/chrome-devtools-cli/main/install.sh | bashOr download and run the script manually:
curl -fsSL https://raw.githubusercontent.com/pleaseai/chrome-devtools-cli/main/install.sh -o install.sh
chmod +x install.sh
./install.sh# macOS (Apple Silicon)
curl -L https://github.com/pleaseai/chrome-devtools-cli/releases/latest/download/chrome-devtools-darwin-arm64 -o chrome-devtools
chmod +x chrome-devtools
sudo mv chrome-devtools /usr/local/bin/
# macOS (Intel)
curl -L https://github.com/pleaseai/chrome-devtools-cli/releases/latest/download/chrome-devtools-darwin-x64 -o chrome-devtools
chmod +x chrome-devtools
sudo mv chrome-devtools /usr/local/bin/
# Linux (ARM64)
curl -L https://github.com/pleaseai/chrome-devtools-cli/releases/latest/download/chrome-devtools-linux-arm64 -o chrome-devtools
chmod +x chrome-devtools
sudo mv chrome-devtools /usr/local/bin/
# Linux (x64)
curl -L https://github.com/pleaseai/chrome-devtools-cli/releases/latest/download/chrome-devtools-linux-x64 -o chrome-devtools
chmod +x chrome-devtools
sudo mv chrome-devtools /usr/local/bin/# Global installation
npm install -g @pleaseai/chrome-devtools-cli
# or
bun add -g @pleaseai/chrome-devtools-clinpm install @pleaseai/chrome-devtools-cli
# or
bun add @pleaseai/chrome-devtools-cliInstall as a plugin for Claude Code to get integrated skill documentation and automation support.
/plugin marketplace add pleaseai/claude-code-plugins/plugin install chrome-devtools-cli@pleaseaiOnce installed, access comprehensive usage skills directly within Claude Code with automated guidance for browser automation, debugging, and performance testing workflows.
# Open a new page
chrome-devtools nav new-page --url https://example.com
# Navigate current page
chrome-devtools nav navigate --url https://google.comchrome-devtools debug screenshot --path screenshot.png --full-pagechrome-devtools perf analyze --url https://example.com --format json# Start monitoring
chrome-devtools network start-monitoring
# List requests
chrome-devtools network list-requests --format toonchrome-devtools [global-options] <command> [command-options]Global Options:
--browser-url <url>- Connect to running Chrome via port forwarding--ws-endpoint <endpoint>- WebSocket endpoint for Chrome--ws-headers <headers>- Custom WebSocket headers (JSON)--headless- Run in headless mode--executable-path <path>- Path to Chrome executable--isolated- Use temporary user data directory--channel <channel>- Chrome channel (stable|canary|beta|dev)--viewport <viewport>- Initial viewport size (e.g., 1280x720)--proxy-server <proxy>- Proxy server configuration--accept-insecure-certs- Ignore certificate errors--format <format>- Output format (json|toon|text)
chrome-devtools input click --uid <element-uid>
chrome-devtools input click --uid <element-uid> --dbl-clickchrome-devtools input hover --uid <element-uid>chrome-devtools input fill --uid <element-uid> --value "text"chrome-devtools input press-key --key Enter
chrome-devtools input press-key --key "Control+C"chrome-devtools input drag --from <source-uid> --to <target-uid>chrome-devtools input upload-file --uid <input-uid> --file /path/to/file.pdfchrome-devtools input handle-dialog --action accept
chrome-devtools input handle-dialog --action dismiss
chrome-devtools input handle-dialog --action accept --prompt-text "my input"chrome-devtools nav list-pages
chrome-devtools nav list-pages --format jsonchrome-devtools nav select-page --index 0chrome-devtools nav close-page --index 1chrome-devtools nav new-page --url https://example.com
chrome-devtools nav new-page --url https://example.com --timeout 30000chrome-devtools nav navigate --url https://example.comchrome-devtools nav wait-for --selector "#my-element"
chrome-devtools nav wait-for --text "Welcome"
chrome-devtools nav wait-for --selector ".button" --timeout 5000chrome-devtools emulate device --name "iPhone 13"
chrome-devtools emulate device --name "iPad Pro"chrome-devtools emulate resize --width 1920 --height 1080chrome-devtools perf start-tracechrome-devtools perf stop-trace --output trace.jsonchrome-devtools perf analyze --url https://example.com
chrome-devtools perf analyze --url https://example.com --duration 5000 --format jsonchrome-devtools network start-monitoringchrome-devtools network list-requests
chrome-devtools network list-requests --limit 10 --offset 0 --format toonchrome-devtools network get-request --id req-123chrome-devtools network clearchrome-devtools debug start-console-monitoringchrome-devtools debug list-console
chrome-devtools debug list-console --types error,warning --format jsonchrome-devtools debug get-console --id msg-123chrome-devtools debug clear-consolechrome-devtools debug evaluate --script "document.title"
chrome-devtools debug evaluate --script "window.innerWidth" --format jsonchrome-devtools debug screenshot --path screenshot.png
chrome-devtools debug screenshot --path screenshot.jpg --type jpeg --quality 80
chrome-devtools debug screenshot --full-page --path full-page.pngchrome-devtools debug snapshot
chrome-devtools debug snapshot --verbosechrome-devtools closeHuman-readable output format for console display.
chrome-devtools nav list-pagesStandard JSON format for programmatic consumption.
chrome-devtools nav list-pages --format jsonToken-optimized format that reduces output size by ~58.9% compared to JSON, ideal for LLM processing.
chrome-devtools nav list-pages --format toonmacOS:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
--remote-debugging-port=9222 \
--user-data-dir=/tmp/chrome-profileLinux:
/usr/bin/google-chrome \
--remote-debugging-port=9222 \
--user-data-dir=/tmp/chrome-profileWindows:
"C:\Program Files\Google\Chrome\Application\chrome.exe" ^
--remote-debugging-port=9222 ^
--user-data-dir="%TEMP%\chrome-profile"chrome-devtools --browser-url http://127.0.0.1:9222 nav list-pages# Get WebSocket URL from http://127.0.0.1:9222/json/version
chrome-devtools --ws-endpoint ws://127.0.0.1:9222/devtools/browser/<id> nav list-pageschrome-devtools --headless nav new-page --url https://example.com
chrome-devtools --headless debug screenshot --path screenshot.pngchrome-devtools --channel canary nav new-page --url https://example.com
chrome-devtools --channel beta perf analyze --url https://example.comchrome-devtools --isolated nav new-page --url https://example.com# 1. Start console and network monitoring
chrome-devtools debug start-console-monitoring
chrome-devtools network start-monitoring
# 2. Navigate to a page
chrome-devtools nav new-page --url https://example.com
# 3. Interact with the page
chrome-devtools input fill --uid input-email --value "user@example.com"
chrome-devtools input fill --uid input-password --value "password123"
chrome-devtools input click --uid button-login
# 4. Wait for navigation
chrome-devtools nav wait-for --text "Dashboard"
# 5. Take a screenshot
chrome-devtools debug screenshot --path dashboard.png
# 6. Get console errors
chrome-devtools debug list-console --types error --format json
# 7. Get network requests
chrome-devtools network list-requests --format toon
# 8. Clean up
chrome-devtools close# Analyze performance with trace
chrome-devtools perf start-trace
chrome-devtools nav new-page --url https://example.com
chrome-devtools nav wait-for --timeout 5000
chrome-devtools perf stop-trace --output trace.json
# Or use the combined analyze command
chrome-devtools perf analyze \
--url https://example.com \
--duration 10000 \
--format json > performance-report.json# Test on iPhone
chrome-devtools emulate device --name "iPhone 13"
chrome-devtools nav new-page --url https://example.com
chrome-devtools debug screenshot --path mobile-view.png
# Test on iPad
chrome-devtools emulate device --name "iPad Pro"
chrome-devtools nav navigate --url https://example.com
chrome-devtools debug screenshot --path tablet-view.png
# Custom viewport
chrome-devtools emulate resize --width 375 --height 667This CLI provides browser automation capabilities using:
- Puppeteer - Browser automation
- Commander.js - CLI framework
- @pleaseai/cli-toolkit - Output formatting and utilities
chrome-devtools-cli/
├── src/
│ ├── browser/ # Browser management utilities
│ ├── commands/ # Command implementations
│ │ ├── input.ts # Input automation
│ │ ├── navigation.ts # Navigation commands
│ │ ├── emulation.ts # Device emulation
│ │ ├── performance.ts # Performance analysis
│ │ ├── network.ts # Network inspection
│ │ └── debugging.ts # Debugging tools
│ ├── cli.ts # CLI entry point
│ ├── types.ts # TypeScript types
│ └── index.ts # Library exports
├── references/
│ └── chrome-devtools-mcp/ # Submodule reference
└── package.json
The CLI can also be used programmatically:
import {
click,
closeBrowser,
getBrowser,
navigatePage,
performanceAnalyzeInsight,
takeScreenshot,
} from '@pleaseai/chrome-devtools-cli'
// Navigate to a page
await navigatePage({ url: 'https://example.com' })
// Take a screenshot
const screenshot = await takeScreenshot({
path: 'screenshot.png',
fullPage: true,
})
// Analyze performance
const perfData = await performanceAnalyzeInsight({
url: 'https://example.com',
})
// Clean up
await closeBrowser()| Feature | Chrome DevTools MCP | Chrome DevTools CLI |
|---|---|---|
| Interface | MCP Server | CLI Commands |
| Usage | AI Assistants (Claude, Copilot) | Command Line / Scripts |
| Output Format | MCP Protocol | JSON / TOON / Text |
| Token Efficiency | Standard | ~58.9% reduction (TOON) |
| Browser Control | ✅ | ✅ |
| Performance Analysis | ✅ | ✅ |
| Network Inspection | ✅ | ✅ |
| Debugging Tools | ✅ | ✅ |
| Automation Scripts | ❌ | ✅ |
| Programmatic API | ❌ | ✅ |
Contributions are welcome! Please feel free to submit a Pull Request.
MIT © PleaseAI
This project is inspired by the excellent Chrome DevTools MCP by Google LLC.
- Chrome DevTools MCP - MCP server for Chrome DevTools
- @pleaseai/cli-toolkit - CLI utilities for LLM-focused tools
- Puppeteer - Headless Chrome Node.js API
Author: Minsu Lee (@amondnet)