Reference

`peekaboo action`

peekaboo action

action invokes a named accessibility action without synthesizing mouse or keyboard input. The action name is positional; --action remains available as an alternative form.

peekaboo action AXPress --on "$ELEMENT_ID" --snapshot <snapshot-id> --foreground
peekaboo action AXIncrement --on Stepper --app Calculator
peekaboo action --action AXShowMenu --on "$ELEMENT_ID" --pid 1234 --foreground

UIKit and Mac Catalyst apps advertise their custom accessibility actions as Name:<title>\nTarget:<...>\nSelector:<...> instead of AX... names. Pass the <title> (for example peekaboo action "More Controls" --on "$ELEMENT_ID" --foreground, the panel Apple's Home app offers on accessory tiles) and Peekaboo invokes the element's action whose Name: line matches it exactly; case and prefixes are not folded. The full advertised string is accepted as well. Custom actions are not classified as background-safe, so they need --foreground (MCP: a server started with --allow-foreground). If several actions on the element share a title, the request is refused as ambiguous and lists the full names to choose from. A custom action is never background-safe: a title that reads as a background-safe built-in (Increment, Decrement, with or without AX, any case) is not mapped to a custom action of that title. Pass its full advertised name with --foreground (MCP: with foreground authorization) instead. A real AXIncrement keeps its exact name. A name or title the element does not advertise is refused before anything is invoked.

Use --app, --pid, --window-id, --window-title, or --window-index to resolve the intended target without activating it. Window title/index selectors require an app or PID. Actions that can raise or expose foreground UI, including AXPress and AXShowMenu, require --foreground; state-only actions such as AXIncrement remain background-capable. Foreground mode also permits web-content discovery to focus the page when required. The equivalent MCP tool is action, whose background-only policy refuses foreground-exposing actions before dispatch.

Every action resolves through a current UI snapshot. Pass --snapshot explicitly, reuse the latest unmodified see snapshot, or supply app/PID/window target flags so Peekaboo captures a fresh targeted snapshot before dispatch. If no snapshot can be established, the command refuses rather than searching the user's frontmost app. Process-scoped snapshots pin the process generation; exact-window snapshots additionally pin window identity and bounds. Missing or changed generation evidence is refused before element resolution or dispatch.

A concrete --snapshot already identifies the app and window; do not combine it with target flags. Omit the concrete snapshot (or use --snapshot latest) with target flags to capture a fresh targeted snapshot. Conflicts return INVALID_INPUT with a retry-safe, non-dispatched refusal before runtime discovery.

Remote element actions require Bridge protocol 1.37 and processGenerationBoundElementMutations; older or receiptless hosts are refused before the request is sent. The final resolved Accessibility element must report the same PID as the snapshot receipt.

Successful JSON and MCP results include the canonical target_identity and target_receipt, including the process-start identity needed to distinguish a live process from PID reuse.

When JSON reports requires_fresh_observation: true, or the host cannot return a canonical outcome, that snapshot remains readable for diagnostics but cannot drive another mutation. Run peekaboo see again and use its new snapshot ID; replaying the old ID is refused before dispatch.