peekaboo list
peekaboo list is a container command that fans out into focused inventory subcommands. Each subcommand returns human-readable tables by default and emits the same structure in JSON when --json is set, so agents can choose whichever format fits their control loop.
#Subcommands
| Subcommand | What it does | Notable options | ||
|---|---|---|---|---|
apps (default) | Enumerates every running GUI app with bundle ID, PID, and focus status. | None – but it enforces screen-recording permission before scanning. | ||
windows | Lists the windows owned by a specific process with optional bounds/ID metadata. | `--app <name | bundle | PID:1234> (required), --pid, --include-details bounds,ids,off_screen`. |
menubar | Dumps every status-item title/index so you can target them via menubar click. | Supports --json for scripts piping into jq. | ||
screens | Shows connected displays, resolution, scaling, and whether they are main/secondary. | None. | ||
permissions | Mirrors peekaboo permissions status for quick entitlement checks. | None. |
#Implementation notes
- The root command does nothing; Commander dispatches straight to the subcommand so
peekaboo listdefaults tolist apps. - Read-only inventory subcommands run locally by default to keep repeated agent inventory calls fast; pass
--bridge-socket <path>when you explicitly want a bridge host to answer. appsandwindowscallrequireScreenRecordingPermissionbefore crawling AX so macOS doesn’t silently strip metadata.windowsaccepts either user-friendly names orPID:####tokens and normalizes--include-detailsvalues by lowercasing + replacing-with_, so both--include-details offscreen,boundsandoff_screenwork.- Menu bar listing is powered by the same
MenuServiceBridgeused bypeekaboo menubar, so indices reported here line up with whatmenubar click --indexexpects. - App/window/screen inventory uses
UnifiedToolOutputpayloads, which includedata,summary, andmetadata.list permissions --jsonmirrorspermissions status --jsonwith the standard{ success, data }envelope.
#Examples
# Default invocation: list every app currently visible to AX
peekaboo list
# Inspect all Chrome windows including their bounds + element IDs
peekaboo list windows --app "Google Chrome" --include-details bounds,ids
# Pipe the current display layout into jq for scripting
peekaboo list screens --json | jq '.data.screens[] | {name, size: .frame}'
#Troubleshooting
- Verify Screen Recording + Accessibility permissions (
peekaboo permissions status). - Confirm your target (app/window/selector) with
peekaboo list/peekaboo seebefore rerunning. - Re-run with
--jsonor--verboseto surface detailed errors.