
# agent-view
**DevTools for AI agents. Electron, Tauri, Chromium.**
Your agent sees the DOM, state, console and network of a running app, and clicks through it like a user.
[](https://www.npmjs.com/package/@petukhovart/agent-view)
[](https://github.com/PetukhovArt/agent-view/actions/workflows/ci.yml)
[](LICENSE)
Agents read your code and your tests. They can't see whether the button is disabled, whether the modal opened or whether the store mutated. agent-view is one CLI that answers those questions over Chrome DevTools Protocol, for any agent that can run a shell command.
## Why agent-view
- **Real input, iframes included.** `click`, `fill`, `key`, `drag` and `hover` fire CDP input events, so Vue `v-model`, React controlled inputs and native fields accept the value, inside same-process iframes too.
- **Compact output.** `dom` prints the accessibility tree with `[ref=N]` handles and test ids; `--compact`, `--diff` and `--count` keep it 40–60% smaller, `screenshot --crop --scale` does the same for images.
- **Workers, windows, background.** Console, network and state reach shared, service and dedicated workers; `--window` addresses settings, tray and detached windows; the app stays behind other windows and never takes focus.
- **Answers, not screenshots.** `network` records from page load on, WebSocket and SSE frames included; `logs` keeps a console feed that survives reloads; `watch` prints JSON-patches of any expression, `coverage` tells whether an action reached a function, `heap` diffs snapshots down to the detached DOM and its retainers.
- **WebGL scenes.** `scene` reads the scene graph of PixiJS, CesiumJS or any engine through a hook the app sets; on CesiumJS and the hook `click --scene` clicks an object in it.
- **Replayable and fast.** `act` saves a path through the app and replays it in seconds without a model; a lazy daemon keeps one CDP socket: `dom → click → dom` in about 17 ms.
Running arbitrary JS (`allowEval`) and keeping response bodies (`captureBody`) stay off until the project turns them on.
## Quick start
```bash
npm install -g @petukhovart/agent-view
agent-view init # writes agent-view.config.json: runtime, CDP port, launch command
agent-view launch # starts the app and waits for CDP
agent-view dom --filter "Submit" # accessibility tree with [ref=N] handles
agent-view click 12 # a ref from the dom output
```
The app has to open a CDP port matching `port` in the config: