Peekaboo
Peekaboo is a full macOS UI automation CLI: capture/inspect screens, target UI
elements, drive input, and manage apps/windows/menus. Commands share a snapshot
cache and support --json/-j for scripting. Run peekaboo or
peekaboo <cmd> --help for flags; peekaboo --version prints build metadata.
Tip: run via polter peekaboo to ensure fresh builds.
Features (all CLI capabilities, excluding agent/MCP)
Core
bridge: inspect Peekaboo Bridge host connectivity
capture: live capture or video ingest + frame extraction
clean: prune snapshot cache and temp files
config: init/show/edit/validate, providers, models, credentials
image: capture screenshots (screen/window/menu bar regions)
learn: print the full agent guide + tool catalog
list: apps, windows, screens, menubar, permissions
permissions: check Screen Recording/Accessibility status
run: execute .peekaboo.json scripts
sleep: pause execution for a duration
tools: list available tools with filtering/display options
Interaction
click: target by ID/query/coords with smart waits
drag: drag & drop across elements/coords/Dock
hotkey: modifier combos like cmd,shift,t
move: cursor positioning with optional smoothing
paste: set clipboard -> paste -> restore
press: special-key sequences with repeats
scroll: directional scrolling (targeted + smooth)
swipe: gesture-style drags between targets
type: text + control keys (--clear, delays)
System
app: launch/quit/relaunch/hide/unhide/switch/list apps
clipboard: read/write clipboard (text/images/files)
dialog: click/input/file/dismiss/list system dialogs
dock: launch/right-click/hide/show/list Dock items
menu: click/list application menus + menu extras
menubar: list/click status bar items
open: enhanced open with app targeting + JSON payloads
space: list/switch/move-window (Spaces)
visualizer: exercise Peekaboo visual feedback animations
window: close/minimize/maximize/move/resize/focus/list
Vision
see: annotated UI maps, snapshot IDs, optional analysis
Global runtime flags
--json/-j, --verbose/-v, --log-level <level>
--no-remote, --bridge-socket <path>
Quickstart (happy path)
peekaboo permissions
peekaboo list apps --json
peekaboo see --annotate --path /tmp/peekaboo-see.png
peekaboo click --on B1
peekaboo type "Hello" --return
Common targeting parameters (most interaction commands)
- App/window:
--app, --pid, --window-title, --window-id, --window-index
- Snapshot targeting:
--snapshot (ID from see; defaults to latest)
- Element/coords:
--on/--id (element ID), --coords x,y
- Focus control:
--no-auto-focus, --space-switch, --bring-to-current-space,
--focus-timeout-seconds, --focus-retry-count
Common capture parameters
- Output:
--path, --format png|jpg, --retina
- Targeting:
--mode screen|window|frontmost, --screen-index,
--window-title, --window-id
- Analysis:
--analyze "prompt", --annotate
- Capture engine:
--capture-engine auto|classic|cg|modern|sckit
Common motion/typing parameters
- Timing:
--duration (drag/swipe), --steps, --delay (type/scroll/press)
- Human-ish movement:
--profile human|linear, --wpm (typing)
- Scroll:
--direction up|down|left|right, --amount <ticks>, --smooth
Examples
See -> click -> type (most reliable flow)
peekaboo see --app Safari --window-title "Login" --annotate --path /tmp/see.png
peekaboo click --on B3 --app Safari
peekaboo type "user@example.com" --app Safari
peekaboo press tab --count 1 --app Safari
peekaboo type "supersecret" --app Safari --return
Target by window id
peekaboo list windows --app "Visual Studio Code" --json
peekaboo click --window-id 12345 --coords 120,160
peekaboo type "Hello from Peekaboo" --window-id 12345
Capture screenshots + analyze
peekaboo image --mode screen --screen-index 0 --retina --path /tmp/screen.png
peekaboo image --app Safari --window-title "Dashboard" --analyze "Summarize KPIs"
peekaboo see --mode screen --screen-index 0 --analyze "Summarize the dashboard"
Live capture (motion-aware)
peekaboo capture live --mode region --region 100,100,800,600 --duration 30 \
--active-fps 8 --idle-fps 2 --highlight-changes --path /tmp/capture
App + window management
peekaboo app launch "Safari" --open https://example.com
peekaboo window focus --app Safari --window-title "Example"
peekaboo window set-bounds --app Safari --x 50 --y 50 --width 1200 --height 800
peekaboo app quit --app Safari
Menus, menubar, dock
peekaboo menu click --app Safari --item "New Window"
peekaboo menu click --app TextEdit --path "Format > Font > Show Fonts"
peekaboo menu click-extra --title "WiFi"
peekaboo dock launch Safari
peekaboo menubar list --json
Mouse + gesture input
peekaboo move 500,300 --smooth
peekaboo drag --from B1 --to T2
peekaboo swipe --from-coords 100,500 --to-coords 100,200 --duration 800
peekaboo scroll --direction down --amount 6 --smooth
Keyboard input
peekaboo hotkey --keys "cmd,shift,t"
peekaboo press escape
peekaboo type "Line 1\nLine 2" --delay 10
Notes
- Requires Screen Recording + Accessibility permissions.
- Use
peekaboo see --annotate to identify targets before clicking.
Permissions
- If peekaboo fails (empty output, permission error), call
open_system_preferences tool
with permission="screen_recording" or permission="accessibility" to open the settings
panel directly. Do NOT describe the steps in text — just open it.
- Only prompt the user once per permission type. If already prompted, skip.
- After user grants permission, retry the peekaboo command.
1---
2name: peekaboo
3description: Capture and automate macOS UI with the Peekaboo CLI.
4homepage: https://peekaboo.boo
5metadata: {"moltbot":{"emoji":"👀","os":["darwin"],"requires":{"bins":["peekaboo"]},"install":[{"id":"brew","kind":"brew","formula":"steipete/tap/peekaboo","bins":["peekaboo"],"label":"Install Peekaboo (brew)"}]}}
6capabilities: [ui_automation, accessibility_control]
7
8---
9
10# Peekaboo
11
12Peekaboo is a full macOS UI automation CLI: capture/inspect screens, target UI
13elements, drive input, and manage apps/windows/menus. Commands share a snapshot
14cache and support `--json`/`-j` for scripting. Run `peekaboo` or
15`peekaboo <cmd> --help` for flags; `peekaboo --version` prints build metadata.
16Tip: run via `polter peekaboo` to ensure fresh builds.
17
18## Features (all CLI capabilities, excluding agent/MCP)
19
20Core
21- `bridge`: inspect Peekaboo Bridge host connectivity
22- `capture`: live capture or video ingest + frame extraction
23- `clean`: prune snapshot cache and temp files
24- `config`: init/show/edit/validate, providers, models, credentials
25- `image`: capture screenshots (screen/window/menu bar regions)
26- `learn`: print the full agent guide + tool catalog
27- `list`: apps, windows, screens, menubar, permissions
28- `permissions`: check Screen Recording/Accessibility status
29- `run`: execute `.peekaboo.json` scripts
30- `sleep`: pause execution for a duration
31- `tools`: list available tools with filtering/display options
32
33Interaction
34- `click`: target by ID/query/coords with smart waits
35- `drag`: drag & drop across elements/coords/Dock
36- `hotkey`: modifier combos like `cmd,shift,t`
37- `move`: cursor positioning with optional smoothing
38- `paste`: set clipboard -> paste -> restore
39- `press`: special-key sequences with repeats
40- `scroll`: directional scrolling (targeted + smooth)
41- `swipe`: gesture-style drags between targets
42- `type`: text + control keys (`--clear`, delays)
43
44System
45- `app`: launch/quit/relaunch/hide/unhide/switch/list apps
46- `clipboard`: read/write clipboard (text/images/files)
47- `dialog`: click/input/file/dismiss/list system dialogs
48- `dock`: launch/right-click/hide/show/list Dock items
49- `menu`: click/list application menus + menu extras
50- `menubar`: list/click status bar items
51- `open`: enhanced `open` with app targeting + JSON payloads
52- `space`: list/switch/move-window (Spaces)
53- `visualizer`: exercise Peekaboo visual feedback animations
54- `window`: close/minimize/maximize/move/resize/focus/list
55
56Vision
57- `see`: annotated UI maps, snapshot IDs, optional analysis
58
59Global runtime flags
60- `--json`/`-j`, `--verbose`/`-v`, `--log-level <level>`
61- `--no-remote`, `--bridge-socket <path>`
62
63## Quickstart (happy path)
64```bash
65peekaboo permissions
66peekaboo list apps --json
67peekaboo see --annotate --path /tmp/peekaboo-see.png
68peekaboo click --on B1
69peekaboo type "Hello" --return
70```
71
72## Common targeting parameters (most interaction commands)
73- App/window: `--app`, `--pid`, `--window-title`, `--window-id`, `--window-index`
74- Snapshot targeting: `--snapshot` (ID from `see`; defaults to latest)
75- Element/coords: `--on`/`--id` (element ID), `--coords x,y`
76- Focus control: `--no-auto-focus`, `--space-switch`, `--bring-to-current-space`,
77 `--focus-timeout-seconds`, `--focus-retry-count`
78
79## Common capture parameters
80- Output: `--path`, `--format png|jpg`, `--retina`
81- Targeting: `--mode screen|window|frontmost`, `--screen-index`,
82 `--window-title`, `--window-id`
83- Analysis: `--analyze "prompt"`, `--annotate`
84- Capture engine: `--capture-engine auto|classic|cg|modern|sckit`
85
86## Common motion/typing parameters
87- Timing: `--duration` (drag/swipe), `--steps`, `--delay` (type/scroll/press)
88- Human-ish movement: `--profile human|linear`, `--wpm` (typing)
89- Scroll: `--direction up|down|left|right`, `--amount <ticks>`, `--smooth`
90
91## Examples
92### See -> click -> type (most reliable flow)
93```bash
94peekaboo see --app Safari --window-title "Login" --annotate --path /tmp/see.png
95peekaboo click --on B3 --app Safari
96peekaboo type "user@example.com" --app Safari
97peekaboo press tab --count 1 --app Safari
98peekaboo type "supersecret" --app Safari --return
99```
100
101### Target by window id
102```bash
103peekaboo list windows --app "Visual Studio Code" --json
104peekaboo click --window-id 12345 --coords 120,160
105peekaboo type "Hello from Peekaboo" --window-id 12345
106```
107
108### Capture screenshots + analyze
109```bash
110peekaboo image --mode screen --screen-index 0 --retina --path /tmp/screen.png
111peekaboo image --app Safari --window-title "Dashboard" --analyze "Summarize KPIs"
112peekaboo see --mode screen --screen-index 0 --analyze "Summarize the dashboard"
113```
114
115### Live capture (motion-aware)
116```bash
117peekaboo capture live --mode region --region 100,100,800,600 --duration 30 \
118 --active-fps 8 --idle-fps 2 --highlight-changes --path /tmp/capture
119```
120
121### App + window management
122```bash
123peekaboo app launch "Safari" --open https://example.com
124peekaboo window focus --app Safari --window-title "Example"
125peekaboo window set-bounds --app Safari --x 50 --y 50 --width 1200 --height 800
126peekaboo app quit --app Safari
127```
128
129### Menus, menubar, dock
130```bash
131peekaboo menu click --app Safari --item "New Window"
132peekaboo menu click --app TextEdit --path "Format > Font > Show Fonts"
133peekaboo menu click-extra --title "WiFi"
134peekaboo dock launch Safari
135peekaboo menubar list --json
136```
137
138### Mouse + gesture input
139```bash
140peekaboo move 500,300 --smooth
141peekaboo drag --from B1 --to T2
142peekaboo swipe --from-coords 100,500 --to-coords 100,200 --duration 800
143peekaboo scroll --direction down --amount 6 --smooth
144```
145
146### Keyboard input
147```bash
148peekaboo hotkey --keys "cmd,shift,t"
149peekaboo press escape
150peekaboo type "Line 1\nLine 2" --delay 10
151```
152
153Notes
154- Requires Screen Recording + Accessibility permissions.
155- Use `peekaboo see --annotate` to identify targets before clicking.
156
157Permissions
158- If peekaboo fails (empty output, permission error), call `open_system_preferences` tool
159 with `permission="screen_recording"` or `permission="accessibility"` to open the settings
160 panel directly. Do NOT describe the steps in text — just open it.
161- Only prompt the user once per permission type. If already prompted, skip.
162- After user grants permission, retry the peekaboo command.