peekaboo

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Peekaboo

Peekaboo

Use for macOS screen capture, UI inspection, and GUI automation.
用于macOS屏幕捕获、UI检查和GUI自动化。

Binary

二进制文件

  • Prefer
    ~/bin/peekaboo
    when present; it is Peter's local release copy.
  • Else use
    peekaboo
    .
  • Check first:
    ~/bin/peekaboo --version || peekaboo --version
    .
  • 优先使用
    ~/bin/peekaboo
    (如果存在),这是Peter的本地发布副本。
  • 否则使用
    peekaboo
  • 先检查版本:
    ~/bin/peekaboo --version || peekaboo --version

Safety

安全注意事项

  • Check permissions before capture/automation:
    peekaboo permissions status --json
    .
  • Screenshot needs Screen Recording; clicks/typing/window control need Accessibility.
  • On remote Macs, Screenshot may be blocked by missing Screen Recording while clicks/typing still work through Accessibility; continue with clicks or DOM automation when the target is otherwise knowable.
  • Prefer
    --json
    for machine parsing and
    --no-remote
    when testing local TCC.
  • Do not click/type/destructively automate unless user asked or target is a controlled test.
  • 在捕获/自动化前检查权限:
    peekaboo permissions status --json
  • 截图需要屏幕录制权限;点击/输入/窗口控制需要辅助功能权限。
  • 在远程Mac上,若缺少屏幕录制权限,截图功能可能被阻止,但点击/输入仍可通过辅助功能权限正常工作;当目标可被识别时,可继续使用点击或DOM自动化。
  • 机器解析优先使用
    --json
    参数,测试本地TCC时使用
    --no-remote
    参数。
  • 除非用户要求或目标是受控测试环境,否则不要执行点击/输入或破坏性自动化操作。

Common Commands

常用命令

bash
PB="${PEEKABOO_BIN:-$HOME/bin/peekaboo}"
[ -x "$PB" ] || PB="$(command -v peekaboo)"

"$PB" permissions status --json
"$PB" list screens --json
"$PB" list apps --json
"$PB" list windows --app Safari --json
"$PB" image --mode screen --screen-index 0 --path /tmp/screen.png --json --no-remote
"$PB" see --app frontmost --path /tmp/frontmost.png --json --annotate
"$PB" tools --json
"$PB" learn
"$PB" click --coords 100,100 --json
"$PB" type "text" --json
bash
PB="${PEEKABOO_BIN:-$HOME/bin/peekaboo}"
[ -x "$PB" ] || PB="$(command -v peekaboo)"

"$PB" permissions status --json
"$PB" list screens --json
"$PB" list apps --json
"$PB" list windows --app Safari --json
"$PB" image --mode screen --screen-index 0 --path /tmp/screen.png --json --no-remote
"$PB" see --app frontmost --path /tmp/frontmost.png --json --annotate
"$PB" tools --json
"$PB" learn
"$PB" click --coords 100,100 --json
"$PB" type "text" --json

Workflow

工作流程

  1. Resolve
    PB
    as above and confirm version when install state matters.
  2. Run
    permissions status --json
    ; if missing TCC, report exact missing grant.
  3. For screenshots, use
    image
    ; include
    --path
    ,
    --json
    , and usually
    --no-remote
    .
  4. For element targeting, run
    see --json --annotate
    , then click by element id/snapshot.
  5. For long-running/change-aware screen capture, use
    capture live
    ; for video frame sampling, use
    capture video
    .
  6. Use
    tools --json
    for command/tool discovery and
    learn
    when the full agent guide is useful.
  7. Verify output files with
    sips -g pixelWidth -g pixelHeight <path>
    or view the image.
Docs:
~/Projects/Peekaboo/docs/commands/
.
  1. 按上述方式解析
    PB
    路径,若安装状态重要则确认版本。
  2. 运行
    permissions status --json
    ;若缺少TCC权限,报告具体缺失的权限项。
  3. 截图时使用
    image
    命令;需包含
    --path
    --json
    参数,通常还需
    --no-remote
    参数。
  4. 定位元素时,运行
    see --json --annotate
    ,然后通过元素ID/快照进行点击操作。
  5. 长期运行/感知变化的屏幕捕获使用
    capture live
    ;视频帧采样使用
    capture video
  6. 使用
    tools --json
    进行命令/工具发现,需要完整Agent指南时使用
    learn
    命令。
  7. 使用
    sips -g pixelWidth -g pixelHeight <path>
    验证输出文件,或直接查看图片。
文档路径:
~/Projects/Peekaboo/docs/commands/