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