snapshot
Capture screenshot + DOM tree + page state + storage in one shot.
Bridge Required
This command requires an active bridge connection and platform screenshot tools.
Usage
Options
| Option | Description | Default |
|---|---|---|
-o, --output <prefix> |
Output path prefix (e.g. /tmp/debug) |
(required) |
-s, --selector <css> |
CSS selector to screenshot (full window if omitted) | — |
-t, --title <regex> |
Window title to match | auto-discover |
--dom-depth <number> |
DOM tree depth | 3 |
--eval <js> |
Additional JS to eval and save | — |
--json |
Output structured manifest | — |
--port <number> |
Bridge port (auto-discover if omitted) | — |
--token <string> |
Bridge token (auto-discover if omitted) | — |
Output Files
Given -o /tmp/debug, the command writes:
| File | Contents |
|---|---|
/tmp/debug-screenshot.png |
Full window or element screenshot |
/tmp/debug-dom.json |
DOM tree serialized to depth |
/tmp/debug-page-state.json |
URL, title, viewport, scroll position, Tauri detection |
/tmp/debug-storage.json |
localStorage and sessionStorage contents |
/tmp/debug-eval.json |
Custom eval result (only if --eval is provided) |
Examples
Quick debug dump
screenshot: /tmp/debug-screenshot.png
dom: /tmp/debug-dom.json
pageState: /tmp/debug-page-state.json
storage: /tmp/debug-storage.json
Screenshot a specific element
Include custom data
JSON manifest for automation
{
"screenshot": "/tmp/snap-screenshot.png",
"dom": "/tmp/snap-dom.json",
"pageState": "/tmp/snap-page-state.json",
"storage": "/tmp/snap-storage.json"
}
Error Handling
Each sub-step (screenshot, DOM, page state, storage, eval) is independent. If one fails, the others still run. Failed steps report an error string instead of a file path: