peekaboo
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePeekaboo
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 / for scripting. Run or
for flags; prints build metadata.
Tip: run via to ensure fresh builds.
--json-jpeekaboopeekaboo <cmd> --helppeekaboo --versionpolter peekabooPeekaboo是一款完整的macOS UI自动化CLI工具:可捕获/检查屏幕、定位UI元素、模拟输入操作,以及管理应用程序/窗口/菜单。所有命令共享快照缓存,并支持/参数用于脚本编写。运行或查看可用参数;会打印构建元数据。提示:通过运行以确保使用最新版本构建。
--json-jpeekaboopeekaboo <cmd> --helppeekaboo --versionpolter peekabooFeatures (all CLI capabilities, excluding agent/MCP)
功能(所有CLI功能,不包含agent/MCP)
Core
- : inspect Peekaboo Bridge host connectivity
bridge - : live capture or video ingest + frame extraction
capture - : prune snapshot cache and temp files
clean - : init/show/edit/validate, providers, models, credentials
config - : capture screenshots (screen/window/menu bar regions)
image - : print the full agent guide + tool catalog
learn - : apps, windows, screens, menubar, permissions
list - : check Screen Recording/Accessibility status
permissions - : execute
runscripts.peekaboo.json - : pause execution for a duration
sleep - : list available tools with filtering/display options
tools
Interaction
- : target by ID/query/coords with smart waits
click - : drag & drop across elements/coords/Dock
drag - : modifier combos like
hotkeycmd,shift,t - : cursor positioning with optional smoothing
move - : set clipboard -> paste -> restore
paste - : special-key sequences with repeats
press - : directional scrolling (targeted + smooth)
scroll - : gesture-style drags between targets
swipe - : text + control keys (
type, delays)--clear
System
- : launch/quit/relaunch/hide/unhide/switch/list apps
app - : read/write clipboard (text/images/files)
clipboard - : click/input/file/dismiss/list system dialogs
dialog - : launch/right-click/hide/show/list Dock items
dock - : click/list application menus + menu extras
menu - : list/click status bar items
menubar - : enhanced
openwith app targeting + JSON payloadsopen - : list/switch/move-window (Spaces)
space - : exercise Peekaboo visual feedback animations
visualizer - : close/minimize/maximize/move/resize/focus/list
window
Vision
- : annotated UI maps, snapshot IDs, optional analysis
see
Global runtime flags
- /
--json,-j/--verbose,-v--log-level <level> - ,
--no-remote--bridge-socket <path>
核心功能
- :检查Peekaboo Bridge主机连接状态
bridge - :实时捕获或视频导入 + 帧提取
capture - :清理快照缓存和临时文件
clean - :初始化/查看/编辑/验证配置、提供者、模型、凭据
config - :捕获屏幕截图(屏幕/窗口/菜单栏区域)
image - :打印完整的agent指南 + 工具目录
learn - :列出应用程序、窗口、屏幕、菜单栏、权限
list - :检查屏幕录制/辅助功能权限状态
permissions - :执行
run脚本.peekaboo.json - :暂停执行指定时长
sleep - :列出可用工具,支持过滤/显示选项
tools
交互功能
- :通过ID/查询/坐标定位目标,支持智能等待
click - :在元素/坐标/程序坞之间拖放
drag - :组合键操作,例如
hotkeycmd,shift,t - :定位光标,可选平滑移动效果
move - :设置剪贴板内容 -> 粘贴 -> 恢复原剪贴板内容
paste - :特殊按键序列,支持重复操作
press - :定向滚动(目标定位 + 平滑滚动)
scroll - :在目标间执行手势式拖动
swipe - :输入文本 + 控制键(支持
type参数、延迟输入)--clear
系统功能
- :启动/退出/重启/隐藏/显示/切换/列出应用程序
app - :读取/写入剪贴板内容(文本/图片/文件)
clipboard - :点击/输入/选择文件/关闭/列出系统对话框
dialog - :启动/右键点击/隐藏/显示/列出程序坞项目
dock - :点击/列出应用程序菜单 + 额外菜单项
menu - :列出/点击状态栏项目
menubar - :增强版
open命令,支持应用定位 + JSON负载open - :列出/切换/移动窗口到不同桌面(Spaces)
space - :演示Peekaboo的视觉反馈动画
visualizer - :关闭/最小化/最大化/移动/调整大小/聚焦/列出窗口
window
视觉功能
- :生成带注释的UI映射图、快照ID,可选分析功能
see
全局运行参数
- /
--json、-j/--verbose、-v--log-level <level> - 、
--no-remote--bridge-socket <path>
Quickstart (happy path)
快速入门(最佳实践)
bash
peekaboo permissions
peekaboo list apps --json
peekaboo see --annotate --path /tmp/peekaboo-see.png
peekaboo click --on B1
peekaboo type "Hello" --returnbash
peekaboo permissions
peekaboo list apps --json
peekaboo see --annotate --path /tmp/peekaboo-see.png
peekaboo click --on B1
peekaboo type "Hello" --returnCommon targeting parameters (most interaction commands)
通用定位参数(大多数交互命令适用)
- App/window: ,
--app,--pid,--window-title,--window-id--window-index - Snapshot targeting: (ID from
--snapshot; defaults to latest)see - Element/coords: /
--on(element ID),--id--coords x,y - Focus control: ,
--no-auto-focus,--space-switch,--bring-to-current-space,--focus-timeout-seconds--focus-retry-count
- 应用/窗口:、
--app、--pid、--window-title、--window-id--window-index - 快照定位:(来自
--snapshot命令的ID;默认使用最新快照)see - 元素/坐标:/
--on(元素ID)、--id--coords x,y - 聚焦控制:、
--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
- 输出:、
--path、--format png|jpg--retina - 定位:、
--mode screen|window|frontmost、--screen-index、--window-title--window-id - 分析:、
--analyze "prompt"--annotate - 捕获引擎:
--capture-engine auto|classic|cg|modern|sckit
Common motion/typing parameters
通用运动/输入参数
- Timing: (drag/swipe),
--duration,--steps(type/scroll/press)--delay - Human-ish movement: ,
--profile human|linear(typing)--wpm - Scroll: ,
--direction up|down|left|right,--amount <ticks>--smooth
- 时序:(拖动/滑动)、
--duration、--steps(输入/滚动/按键)--delay - 类人化操作:、
--profile human|linear(输入速度)--wpm - 滚动:、
--direction up|down|left|right、--amount <ticks>--smooth
Examples
示例
See -> click -> type (most reliable flow)
查看 -> 点击 -> 输入(最可靠流程)
bash
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 --returnbash
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 --returnTarget by window id
通过窗口ID定位
bash
peekaboo list windows --app "Visual Studio Code" --json
peekaboo click --window-id 12345 --coords 120,160
peekaboo type "Hello from Peekaboo" --window-id 12345bash
peekaboo list windows --app "Visual Studio Code" --json
peekaboo click --window-id 12345 --coords 120,160
peekaboo type "Hello from Peekaboo" --window-id 12345Capture screenshots + analyze
捕获屏幕截图 + 分析
bash
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"bash
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)
实时捕获(运动感知)
bash
peekaboo capture live --mode region --region 100,100,800,600 --duration 30 \
--active-fps 8 --idle-fps 2 --highlight-changes --path /tmp/capturebash
peekaboo capture live --mode region --region 100,100,800,600 --duration 30 \
--active-fps 8 --idle-fps 2 --highlight-changes --path /tmp/captureApp + window management
应用 + 窗口管理
bash
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 Safaribash
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 SafariMenus, menubar, dock
菜单、菜单栏、程序坞
bash
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 --jsonbash
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 --jsonMouse + gesture input
鼠标 + 手势输入
bash
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 --smoothbash
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 --smoothKeyboard input
键盘输入
bash
peekaboo hotkey --keys "cmd,shift,t"
peekaboo press escape
peekaboo type "Line 1\nLine 2" --delay 10Notes
- Requires Screen Recording + Accessibility permissions.
- Use to identify targets before clicking.
peekaboo see --annotate
bash
peekaboo hotkey --keys "cmd,shift,t"
peekaboo press escape
peekaboo type "Line 1\nLine 2" --delay 10注意事项
- 需要屏幕录制 + 辅助功能权限。
- 点击操作前,使用命令定位目标元素。
peekaboo see --annotate