Peekaboo
Attribution: Sourced from steipete/agent-scripts by Peter Steinberger.
Use for macOS screen capture, UI inspection, and GUI automation.
Binary
- Check first:
peekaboo --version. - Prefer
~/bin/peekaboowhen present (local release copy), elsepeekaboo.
Safety
- Check permissions before capture/automation:
peekaboo permissions status --json. - Screenshot needs Screen Recording; clicks/typing/window control need Accessibility.
- Do not click/type/destructively automate unless user asked or target is a controlled test.
Common Commands
PB="${PEEKABOO_BIN:-$HOME/bin/peekaboo}"
[ -x "$PB" ] || PB="$(command -v peekaboo)"
# Check permissions
"$PB" permissions status --json
# List screens and apps
"$PB" list screens --json
"$PB" list apps --json
"$PB" list windows --app Safari --json
# Screenshots
"$PB" image --mode screen --screen-index 0 --path /tmp/screen.png --json
"$PB" see --app frontmost --path /tmp/frontmost.png --json --annotate
# Automation
"$PB" click --coords 100,100 --json
"$PB" type "text" --json
# Discovery
"$PB" tools --json
"$PB" learn
Workflow
- Resolve binary and confirm version.
- Run
permissions status --json; if missing TCC, report exact missing grant. - For screenshots, use
image; include--path,--json, and usually--no-remote. - For element targeting, run
see --json --annotate, then click by element id/snapshot. - Verify output files with
sips -g pixelWidth -g pixelHeight <path>or view the image.
TCC Requirements
| Task | Permission needed |
|---|---|
| Screen capture | Screen Recording |
| Click / type | Accessibility |
| Window list | Accessibility |
| App list | None |