[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-11065":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":13,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":14,"forks30d":14,"starsTrendScore":18,"compositeScore":19,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":9,"pushedAt":9,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":14,"starSnapshotCount":14,"syncStatus":15,"lastSyncTime":27,"discoverSource":28},11065,"chrome-devtools-cli","aeroxy\u002Fchrome-devtools-cli","aeroxy","A high-performance, developer-friendly CLI for interacting with Chrome via the DevTools Protocol (CDP).",null,"Rust",215,7,1,0,2,8,70,6,2.71,false,"main",true,[],"2026-06-12 02:02:29","# Chrome DevTools CLI\n\nRust CLI that connects to an existing Chrome browser via the DevTools Protocol. Auto-connects by default — no manual WebSocket URL needed.\n\n[![crates.io](https:\u002F\u002Fimg.shields.io\u002Fcrates\u002Fv\u002Fchrome-devtools-cli.svg)](https:\u002F\u002Fcrates.io\u002Fcrates\u002Fchrome-devtools-cli)\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-yellow.svg)](.\u002FLICENSE)\n[![Ask DeepWiki](https:\u002F\u002Fdeepwiki.com\u002Fbadge.svg)](https:\u002F\u002Fdeepwiki.com\u002Faeroxy\u002Fchrome-devtools-cli)\n\n## Installation\n\n### Homebrew (macOS, recommended)\n\n```bash\nbrew install aeroxy\u002Ftap\u002Fchrome-devtools\n```\n\n### Cargo\n\n```bash\ncargo install chrome-devtools-cli\n```\n\nThe installed binary is named `chrome-devtools`.\n\n### Build from source\n\n```bash\ncargo build --release\n# Binary: .\u002Ftarget\u002Frelease\u002Fchrome-devtools\n```\n\n## Why this exists\n\nInspired by [chrome-devtools-mcp](https:\u002F\u002Fgithub.com\u002FChromeDevTools\u002Fchrome-devtools-mcp) — the official MCP server for Chrome DevTools. It works well, but MCP-based browser tools consume a lot of token context: every interaction sends and receives large protocol payloads through the MCP layer.\n\n99% of the time the browser being controlled is the user's own Chrome with their own credentials, so there is no need for a full headless browser stack like Puppeteer or Playwright, and no need for the MCP overhead.\n\nThis is a lightweight Rust binary that talks directly to Chrome's DevTools Protocol. One command in, one result out. No separate browser process, no credential handoff, no heavyweight runtime. The agent skill for this tool is a single `SKILL.md` file — the entire context overhead is this documentation.\n\n## Architecture\n\n```\nchrome-devtools navigate https:\u002F\u002Fexample.com\n        │\n        ├─ Try daemon (Unix socket \u002Ftmp\u002Fchrome-devtools-daemon.sock)\n        │   └─ If running → send command → get result\n        │\n        ├─ If no daemon → spawn one (background process)\n        │   └─ Daemon connects to Chrome WebSocket (one-time approval)\n        │   └─ Listens on Unix socket, 5-min idle timeout\n        │\n        └─ Fallback → direct WebSocket connection (no daemon)\n```\n\nThe daemon keeps a persistent WebSocket connection to Chrome, so the browser only prompts for DevTools access once. Subsequent commands reuse the connection.\n\n## Prerequisites\n\nChrome must have remote debugging enabled:\n\n1. Open Chrome\n2. Go to `chrome:\u002F\u002Finspect\u002F#remote-debugging`\n3. Enable the remote debugging server\n\n## Auto-connect\n\nBy default, the CLI reads `DevToolsActivePort` from Chrome's user data directory:\n\n| OS | Default path |\n|----|-------------|\n| macOS | `~\u002FLibrary\u002FApplication Support\u002FGoogle\u002FChrome\u002F` |\n| Linux | `~\u002F.config\u002Fgoogle-chrome\u002F` |\n| Windows | `%LOCALAPPDATA%\\Google\\Chrome\\User Data\\` |\n\nOverride with `--user-data-dir`, `--channel` (beta\u002Fcanary\u002Fdev), or `--ws-endpoint`. All three also read from environment variables:\n\n| Environment Variable | Corresponding Flag |\n|----------------------|--------------------|\n| `CHROME_WS_ENDPOINT` | `--ws-endpoint` |\n| `CHROME_USER_DATA_DIR` | `--user-data-dir` |\n| `CHROME_CHANNEL` | `--channel` |\n\n## Page targeting\n\nEvery page-level command outputs a friendly target name like `[target:red-snake]`. This is a deterministic word-pair derived from Chrome's internal target ID — same page always gets the same name.\n\n```bash\n# Navigate — note the target name\nchrome-devtools navigate https:\u002F\u002Fexample.com\n# Navigated to https:\u002F\u002Fexample.com\n# [target:red-snake]\n\n# Pin subsequent commands to the same page\nchrome-devtools --target red-snake screenshot --output \u002Ftmp\u002Fpage.png\nchrome-devtools --target red-snake evaluate \"document.title\"\n```\n\nWithout `--target`, commands default to page index 0, which may vary as Chrome reorders tabs. Always capture and reuse the target name.\n\n`list-pages` shows all pages with their friendly names:\n\n```\n[0] (green-dog) My App — https:\u002F\u002Flocalhost:3000\n[1] (red-snake) Example Domain — https:\u002F\u002Fexample.com\n[2] (bold-stag) GitHub — https:\u002F\u002Fgithub.com\n```\n\nYou can also use `--page \u003Cindex>` for quick one-offs, or pass the raw hex target ID.\n\n## Commands\n\n### Navigation\n\n| Command | Description |\n|---------|-------------|\n| `navigate \u003Curl>` | Go to URL (waits for load) |\n| `navigate --back` | Go back in history |\n| `navigate --forward` | Go forward |\n| `navigate --reload` | Reload page |\n| `new-page \u003Curl>` | Open new tab |\n| `close-page \u003Cindex>` | Close tab by index |\n| `select-page \u003Cindex>` | Bring tab to front |\n| `list-pages` | List all open tabs |\n\n### Inspection\n\n| Command | Description |\n|---------|-------------|\n| `screenshot --output \u003Cpath>` | Save screenshot to file |\n| `screenshot --full-page` | Capture full scrollable page |\n| `evaluate \u003Cexpr> [--dialog-action \u003Caction>]` | Run JavaScript (optionally handle dialogs: accept, dismiss, or prompt text) |\n| `snapshot` | Accessibility tree dump |\n\n### Interaction\n\n| Command | Description |\n|---------|-------------|\n| `click \u003Cselector>` | Click element by CSS selector |\n| `click-at \u003Cx> \u003Cy>` | Click at specific coordinates |\n| `fill \u003Cselector> \u003Cvalue>` | Fill input field, dropdown (`\u003Cselect>`), or toggle checkbox\u002Fradio (`\"true\"`\u002F`\"false\"`) |\n| `type-text \u003Ctext> [--submit-key \u003Ckey>]` | Type into focused element (optionally press key after) |\n| `press-key \u003Ckey>` | Press key (e.g. `Enter`, `Control+A`) |\n| `hover \u003Cselector>` | Hover over element |\n\n### Third-party developer tools\n\n| Command | Description |\n|---------|-------------|\n| `list-3p-tools` | List custom developer tools exposed via `window.__dtmcp` |\n| `execute-3p-tool \u003Cname> \u003Cparams>` | Execute a custom tool by name with a JSON params string |\n\nThese commands interact with tools injected into the page via `window.__dtmcp.toolGroup` \u002F `window.__dtmcp.executeTool`.\n\n### Other\n\n| Command | Description |\n|---------|-------------|\n| `resize \u003Cw> \u003Ch>` | Set viewport size |\n| `wait-for \u003Ctext> [--timeout ms]` | Wait for text to appear (default 30s) |\n\n## Global options\n\n| Flag | Description |\n|------|-------------|\n| `--target \u003Cname>` | Target page by friendly name or raw ID |\n| `--page \u003Cindex>` | Target page by index |\n| `--json` | JSON output |\n| `--ws-endpoint \u003Curl>` | Explicit WebSocket URL |\n| `--user-data-dir \u003Cpath>` | Custom Chrome profile directory |\n| `--channel \u003Cch>` | Chrome channel (stable\u002Fbeta\u002Fcanary\u002Fdev) |\n\n## Daemon details\n\n- **Socket**: `\u002Ftmp\u002Fchrome-devtools-daemon.sock`\n- **PID file**: `\u002Ftmp\u002Fchrome-devtools-daemon.pid`\n- **Idle timeout**: 5 minutes (auto-exits, cleans up socket)\n- **Protocol**: Length-prefixed JSON over Unix socket\n- **Spawned by**: First CLI invocation (transparent to user)\n- **Kill manually**: `pkill -f __daemon__` or delete the socket\n\n## Source layout\n\n```\nsrc\u002F\n├── main.rs         # CLI (clap) + daemon-first dispatch\n├── cdp.rs          # Raw CDP over WebSocket (JSON-RPC)\n├── browser.rs      # Auto-connect (DevToolsActivePort)\n├── daemon.rs       # Background daemon (persistent connection)\n├── client.rs       # Talks to daemon via Unix socket\n├── protocol.rs     # IPC message types\n├── friendly.rs     # Target ID → word-pair names\n└── commands\u002F\n    ├── navigate.rs\n    ├── pages.rs    # list\u002Fnew\u002Fclose\u002Fselect\u002Fresize\u002Fwait-for\n    ├── screenshot.rs\n    ├── evaluate.rs\n    ├── input.rs    # click\u002Ffill\u002Ftype\u002Fpress\u002Fhover\n    ├── snapshot.rs\n    └── third_party.rs  # list-3p-tools\u002Fexecute-3p-tool\n```\n\n## Typical workflow\n\n```bash\n# 1. Navigate — capture the [target:name]\nchrome-devtools navigate https:\u002F\u002Fexample.com\n# [target:red-snake]\n\n# 2. Understand the page\nchrome-devtools --target red-snake snapshot\nchrome-devtools --target red-snake screenshot --output \u002Ftmp\u002Fpage.png\n\n# 3. Interact\nchrome-devtools --target red-snake fill \"#email\" \"user@example.com\"\nchrome-devtools --target red-snake click \"#submit\"\n\n# 4. Extract data\nchrome-devtools --target red-snake evaluate \"document.title\"\n```\n\nAlways pass `--target` from step 2 onward to stay on the same page.\n\n## Agent skill\n\n`skill\u002Fchrome-devtools\u002FSKILL.md` is a Claude Code skill that teaches the agent how to use this binary. Drop it into any Claude Code plugin's `skills\u002F` directory and set `chrome-devtools` to the binary path. The skill covers the full workflow, all commands, and the `--target` pinning pattern — everything needed to reliably automate Chrome without large context overhead.\n\n## License\n\nMIT\n","chrome-devtools-cli 是一个用 Rust 编写的命令行工具，通过 Chrome DevTools 协议自动连接到已存在的 Chrome 浏览器。其核心功能包括自动检测并连接至用户的 Chrome 实例，无需手动输入 WebSocket URL，极大简化了与浏览器的交互过程。该工具适用于需要直接控制或调试本地 Chrome 浏览器的各种场景，例如自动化测试、页面性能分析等。由于它直接与 Chrome 的 DevTools 协议通信，避免了额外的浏览器进程和复杂的运行时环境，使得操作更加高效简洁。","2026-06-11 03:31:07","CREATED_QUERY"]