import { CodeBlock } from "@/components/code-block"; export default function Snapshots() { return (

Snapshots

The snapshot command returns the accessibility tree with refs for AI-friendly interaction.

Options

Filter output to reduce size:

Option Description
-i, --interactive Only interactive elements (buttons, links, inputs)
-c, --compact Remove empty structural elements
-d, --depth Limit tree depth
-s, --selector Scope to CSS selector

Output format

JSON output

Use --json for machine-readable output:

Best practices

  1. Use -i to reduce output to actionable elements
  2. Use --json for structured parsing
  3. Re-snapshot after page changes to get updated refs
  4. Scope with -s for specific page sections
); }