Usage
Parameters
Filter to a specific application by name (e.g., “Finder”, “Safari”). If omitted, captures the full screen.
Filter to a specific window ID from
list-windows output. Takes precedence over --app.Optional file path to save the screenshot. If provided, the image is written to disk instead of being returned as base64.
Response (Base64 Mode)
When no output path is specified, the screenshot is returned as base64-encoded data.Base64-encoded PNG image data.
Image format (always
"png" in Phase 1).Image width in pixels.
Image height in pixels.
Response (File Mode)
When an output path is specified, the image is saved to disk.Absolute path where the screenshot was saved.
Examples
Capture Finder window as base64
Save screenshot to file
Capture specific window by ID
Full screen capture
Error Cases
Application not found
Window not found
Permission denied
File write error
Notes
- On macOS, capturing screenshots requires Screen Recording permission in addition to Accessibility permission.
- When capturing a specific app, the frontmost window of that app is captured.
- The
--window-idparameter takes precedence over--appif both are specified. - If neither
--appnor--window-idis specified, a full screen capture is performed. - The screenshot is taken using
CGWindowListCreateImageon macOS. - Base64 encoding uses the standard base64 alphabet (RFC 4648).
See Also
- snapshot - Capture the accessibility tree
- list-windows - List all visible windows