[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81345":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":14,"stars7d":14,"stars30d":13,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":15,"rankGlobal":9,"rankLanguage":9,"license":16,"archived":17,"fork":17,"defaultBranch":18,"hasWiki":19,"hasPages":17,"topics":20,"createdAt":9,"pushedAt":9,"updatedAt":21,"readmeContent":22,"aiSummary":23,"trendingCount":14,"starSnapshotCount":14,"syncStatus":12,"lastSyncTime":24,"discoverSource":25},81345,"agent-cdp","callstackincubator\u002Fagent-cdp","callstackincubator","Command-line tool for the Chrome DevTools Protocol (CDP): debug targets, console, traces, heap snapshots, and JavaScript CPU profiling for Chrome, Node.js, and React Native.",null,"TypeScript",42,2,1,0,1.43,"MIT License",false,"master",true,[],"2026-06-12 02:04:14","# agent-cdp\n\n**agent-cdp** is a command-line tool that connects to apps and pages through the **Chrome DevTools Protocol (CDP)**. Use it to list debuggable targets, evaluate runtime expressions, inspect network traffic, stream console output, record traces, inspect JavaScript heap usage, capture and analyze heap snapshots, and run JavaScript CPU profiles, all without opening DevTools yourself.\n\n## Compatibility\n\n| Environment | Notes |\n|-------------|--------|\n| **Chrome \u002F Chromium** | Requires a CDP debug endpoint, typically with remote debugging enabled (for example port `9222`). You can point the CLI at that endpoint explicitly, or let `target list` scan the default local ports. |\n| **React Native** | Works with the Metro \u002F dev tooling that exposes a CDP-compatible target list (often `http:\u002F\u002F127.0.0.1:8081` during development). `target list` scans that port by default, or you can pass the dev server URL explicitly. |\n| **Node.js** | Supports attaching to Node processes started with **`--inspect`** or **`--inspect-brk`** (or the equivalent `NODE_OPTIONS`). They expose the same CDP discovery model as Chrome; `target list` scans the default inspect port (`http:\u002F\u002F127.0.0.1:9229`) automatically, or you can pass your `--inspect=host:port` URL explicitly. |\n\nAnything that exposes the same style of CDP HTTP discovery (`\u002Fjson\u002Flist`) and WebSocket debugging should work; behavior depends on what the target implements.\n\n## Install\n\nInstall the CLI globally with **npm**:\n\n```sh\nnpm install -g agent-cdp\n```\n\nRun it as:\n\n```sh\nagent-cdp \u003Ccommand> [options]\n```\n\nFor the full command tree and flags:\n\n```sh\nagent-cdp --help\n```\n\n**Developing from source:** clone the repository, run `pnpm install` and `pnpm run build`, then from the repo root use `pnpm run agent-cdp -- \u003Ccommand> [options]` (or run `node packages\u002Fagent-cdp\u002Fdist\u002Fcli.js` directly).\n\n## Quick start\n\n**1. Start the background connection helper (daemon)**\n\n```sh\nagent-cdp start\nagent-cdp status\n```\n\n**2. List targets and select one**\n\nBy default, `target list` scans these local discovery URLs in parallel:\n\n- `http:\u002F\u002F127.0.0.1:9222`\n- `http:\u002F\u002F127.0.0.1:9229`\n- `http:\u002F\u002F127.0.0.1:8081`\n\nReturned target IDs embed the discovery URL, so `target select \u003Ctarget-id>` does not require `--url`.\n\nDefault local scan:\n\n```sh\nagent-cdp target list\nagent-cdp target select \u003Ctarget-id>\n```\n\nChrome (example port):\n\n```sh\nagent-cdp target list --url http:\u002F\u002F127.0.0.1:9222\nagent-cdp target select \u003Ctarget-id>\n```\n\nReact Native (example Metro URL):\n\n```sh\nagent-cdp target list --url http:\u002F\u002F127.0.0.1:8081\n```\n\nNode.js (example default inspect port after starting your app with `node --inspect …`):\n\n```sh\nagent-cdp target list --url http:\u002F\u002F127.0.0.1:9229\nagent-cdp target select \u003Ctarget-id>\n```\n\nIf you pass `--url` to `target select`, it must match the discovery URL encoded in the target ID.\n\nClear the current selection when needed:\n\n```sh\nagent-cdp target clear\n```\n\n**3. Use the features you need**\n\n- **Console** — list and fetch log lines: `console list`, `console get \u003Cid>`\n- **Runtime** — evaluate expressions, inspect returned object handles, and release preserved inspector references: `runtime eval`, `runtime props`, `runtime release`, `runtime release-group`\n- **Network** — bounded live capture plus persisted sessions: `network status`, `network start`, `network summary`, `network list`, `network request`, `network request-headers`, `network response-headers`, `network request-body`, `network response-body`\n- **Trace** — explicit trace capture plus in-memory session analysis for `performance.measure`, `performance.mark`, `console.timeStamp`, and custom DevTools tracks: `trace start`, `trace stop`, `trace summary`, `trace tracks`, `trace entries`, `trace entry`\n- **Memory snapshots** — `memory snapshot` commands to capture, load, summarize, diff snapshots, inspect classes\u002Finstances\u002Fretainers, and triage leak-style comparisons\n- **Memory usage** — `memory usage` commands for sampling, summaries, diffs, trends, and leak-oriented signals\n- **Memory allocation** — `memory allocation` commands for sampled allocation timeline summaries, top allocators, bucketed growth, leak-oriented signals, and raw artifact export\n- **Memory allocation timeline** — `memory allocation-timeline` commands for DevTools-style heap allocation timeline capture, bucket summaries, linked final snapshot analysis, and raw artifact export\n- **CPU profiling** — `profile cpu` commands to record CPU profiles, list sessions, hotspots, stacks, diffs, and optional source map help\n\n**4. Stop the daemon**\n\n```sh\nagent-cdp stop\n```\n\n## Command overview\n\nCommands are grouped as **daemon**, **target**, **console**, **runtime**, **network**, **trace**, **memory** (`snapshot`, `usage`, `allocation`, `allocation-timeline`), **profile** (`cpu`), and **skills** (bundled reference files). See `agent-cdp --help` for exact syntax and options.\n\nFor the runtime SDK bridge and in-app profiling, see `docs\u002FSDK.md`.\n\n## Built-in plugin system\n\nFor architecture, interface contract, and a step-by-step guide to adding a plugin, see [`docs\u002FPLUGINS.md`](..\u002F..\u002Fdocs\u002FPLUGINS.md).\n\n## Runtime inspection\n\nUse `runtime` for live state inspection when you need more than captured console output.\n\nQuick start:\n\n```sh\nagent-cdp runtime eval --expr \"process.version\"\nagent-cdp runtime eval --expr \"globalThis.store\" --await\nagent-cdp runtime props --id \u003COBJECT_ID> --own\nagent-cdp runtime release --id \u003COBJECT_ID>\nagent-cdp runtime release-group\n```\n\nNotes:\n\n- Remote object handles are preserved by default so you can inspect them with `runtime props` after `runtime eval`.\n- Preserved handles should be released when you no longer need them in a long-lived daemon session.\n- `runtime eval` can have side effects if the expression mutates application state.\n\n## Network inspection\n\nUse `network` when you need compact request summaries first, then explicit drill-down commands for details.\n\nQuick start:\n\n```sh\nagent-cdp network status\nagent-cdp network start --name login-flow\n# reproduce the failing or slow interaction\nagent-cdp network stop\nagent-cdp network summary --session net_1\nagent-cdp network list --session net_1 --status failed\nagent-cdp network request --session net_1 --id req_12\nagent-cdp network response-headers --session net_1 --id req_12\nagent-cdp network response-body --session net_1 --id req_12 --file .\u002Fresponse-body.txt\n```\n\nDefault behavior:\n\n- The daemon keeps an always-on live rolling buffer of the most recent `200` normalized requests for the active target.\n- `network start` begins an empty persisted recording session. It does not backfill from the live buffer.\n- When `--session` is omitted, `network` queries prefer the active or latest persisted session. If no session exists, they read from the live buffer.\n- `network request` shows metadata, timing, sizes, redirects, and availability flags only. It does not print headers or body previews by default.\n- Use `network request-headers`, `network response-headers`, `network request-body`, and `network response-body` for explicit drill-down.\n\nExamples:\n\n```sh\nagent-cdp network list --type xhr --min-ms 500\nagent-cdp network list --status 5xx --text graphql\nagent-cdp network request --id req_7\nagent-cdp network request-headers --id req_7 --name authorization\nagent-cdp network response-body --id req_7\n```\n\nCurrent limitations:\n\n- Network tooling depends on the target emitting usable CDP `Network.*` events.\n- Support is capability-driven, not runtime-name-driven. There is no runtime-specific fallback instrumentation in v1.\n- The live buffer is limited to the most recent `200` requests.\n- Persisted sessions start empty and do not backfill from the live buffer.\n- Default request detail omits headers and bodies.\n- No request or response body previews are printed by default.\n- Full request and response bodies may still be unavailable depending on target behavior, timing, and connection lifetime.\n- Binary bodies may be easier to consume through `--file` export.\n- No default redaction is applied in v1.\n- WebSocket visibility is limited to handshake metadata in v1.\n- There is no throttling, blocking, mocking, replay, or HAR export in v1.\n- Timing, size, protocol, cache, and remote-endpoint metadata may be partial or absent depending on target behavior.\n\n## Trace inspection\n\nUse `trace` when you need to capture a bounded trace, then navigate the analyzed results in small, filterable chunks rather than dumping raw `traceEvents` into the terminal.\n\nQuick start:\n\n```sh\nagent-cdp trace start\n# reproduce the interaction you want to inspect\nagent-cdp trace stop\nagent-cdp trace summary\nagent-cdp trace tracks\nagent-cdp trace entries\nagent-cdp trace entry --id te_1\n```\n\nWhat the current trace tooling can inspect:\n\n- plain `performance.measure()` entries\n- plain `performance.mark()` entries\n- `console.timeStamp()` entries, including custom tracks and groups emitted through DevTools timeline events\n- custom track and group metadata attached through DevTools-style `detail.devtools` payloads on user timing entries\n- custom traces emitted by tools like React DevTools when they surface track-based timeline data through the trace stream\n\nDefault behavior:\n\n- Tracing is explicit. The daemon does not start recording on startup; use `trace start` when you want a capture.\n- `trace stop` stores an analyzed trace session in daemon memory so agents can query it immediately.\n- `trace stop --file PATH` can still export the raw trace JSON when you need to inspect the underlying `traceEvents` directly.\n- When `--session` is omitted, trace queries read from the latest analyzed session.\n- `trace summary` gives a compact overview first.\n- `trace tracks` lists discovered built-in and custom tracks with pagination\u002Ffiltering.\n- `trace entries` is the main drill-down command; it defaults to measures and supports `--track`, `--type`, `--text`, `--start-ms`, `--end-ms`, `--limit`, `--offset`, and `--sort`.\n- `trace entry` shows the full details for exactly one selected entry.\n\nExamples:\n\n```sh\nagent-cdp trace summary\nagent-cdp trace tracks --group \"Scheduler ⚛\"\nagent-cdp trace entries --track \"Image Processing\" --limit 10\nagent-cdp trace entries --type mark --text boot\nagent-cdp trace entries --start-ms 0 --end-ms 100 --sort duration\nagent-cdp trace entry --id te_16\n```\n\nCurrent limitations:\n\n- Trace analysis is optimized for compact CLI inspection, not full flamechart rendering.\n- Default track output reports active time on a track; use verbose output when you need the broader span between first and last entry.\n- The parser handles common user timing and DevTools custom-track shapes seen in Chrome, React DevTools, and similar tools, but uncommon trace producers may still emit unsupported event forms.\n- Trace sessions are stored in a bounded in-memory history rather than persisted automatically.\n","agent-cdp 是一个基于 Chrome DevTools Protocol (CDP) 的命令行工具，用于调试 Chrome、Node.js 和 React Native 应用。其核心功能包括列出可调试目标、运行时表达式评估、网络流量检查、控制台输出流、记录跟踪信息、JavaScript 堆使用情况检查、堆快照捕获与分析以及 JavaScript CPU 性能分析，而无需手动打开 DevTools。该工具采用 TypeScript 编写，支持多种开发环境，如启用了远程调试的 Chrome\u002FChromium、React Native 开发服务器及带有 `--inspect` 选项启动的 Node.js 进程。它适用于需要通过命令行对 Web 或移动应用进行高效调试和性能优化的场景。","2026-06-11 04:04:43","CREATED_QUERY"]