Overview
Thesnapshot command captures the accessibility tree of an application with configurable options to control what elements are included and how the tree is structured.
Available Options
Filter to a specific application by nameDefault: focused app
Filter to a specific window by ID (from
list-windows)Only include interactive elements in the treeDefault:
falseInteractive elements include: buttons, text fields, checkboxes, links, menu items, tabs, sliders, combo boxes, tree items, cells, radio buttons, and switches.Omit empty structural nodes to reduce tree sizeDefault:
falseCollapses single-child unnamed nodes to reduce tree depth without losing interactive elements.Include pixel bounds (x, y, width, height) for each elementDefault:
falseMaximum tree depth to traverseDefault:
10Limits how deep the accessibility tree traversal will go. Lower values improve performance for complex UIs.Type of UI surface to snapshotDefault:
windowOptions: window, focused, menu, menubar, sheet, popover, alertCommon Patterns
AI Agent Workflow
For optimal LLM performance, use interactive-only mode to reduce tree size:Capture Open Menu
Snapshot the currently open context menu or dropdown:Focused Application
Snapshot the currently focused app without specifying the name:Performance Optimization
For large applications, combine flags to minimize output:Output Format
All snapshots return structured JSON with element refs:Related Commands
- find - Search for elements matching criteria
- list-surfaces - List available UI surfaces
- screenshot - Capture visual screenshot