notis-desktop-use

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Notis Desktop Use Skill

Notis桌面使用技能

Use this skill when a task must operate the user's real Mac — capture what is on screen, inspect a native app's UI, click buttons, type, drive menus, or move windows. The engine is Peekaboo, a signed, notarized macOS automation CLI built on a Swift core.
This is GUI control of the user's own computer. It is not browser automation and it is not a sandbox. For web pages use
notis-browser-control
. For an isolated, reproducible environment use the Vercel Sandbox. Peekaboo needs the live macOS Aqua session, the screen, and TCC permissions, so it only runs on the user's
local_shell
.
当任务必须操作用户的真实Mac时使用此技能——包括捕获屏幕内容、检查原生应用的UI、点击按钮、输入文本、操作菜单或移动窗口。其核心引擎是Peekaboo,一款基于Swift核心开发的已签名、已公证的macOS自动化CLI工具。
这是对用户自有电脑的GUI控制,并非浏览器自动化,也不运行在沙箱环境中。若需操作网页,请使用
notis-browser-control
;若需隔离、可复现的环境,请使用Vercel Sandbox。Peekaboo需要活跃的macOS Aqua会话、屏幕权限以及TCC权限,因此仅能在用户的
local_shell
中运行。

Step 0 — Switch to the LOCAL shell FIRST (mandatory)

步骤0 — 先切换到LOCAL shell(必须执行)

Peekaboo controls the user's physical Mac, so every command must run on the local shell (the Notis desktop bridge), never the Vercel sandbox. Shell calls default to
sandbox_shell
— if you skip this step your
peekaboo
command runs in
/vercel/sandbox
, where Peekaboo does not exist and cannot touch the Mac.
Before any
peekaboo
command, call
set_shell_mode
with
mode: "local_shell"
.
  • If it succeeds, all subsequent shell calls run on the user's Mac. Proceed.
  • Your Computer is available on every plan, including Free. If this call unexpectedly returns
    entitlement_upgrade_required
    , report the access-policy mismatch and stop; do not turn it into Ultra upgrade guidance. If it returns
    entitlement_check_unavailable
    , ask the user to retry.
  • If it returns an error that the Notis desktop app is not connected, tell the user to open the Notis desktop app and turn on Your Computer (computer use) in settings, then stop. Do not run
    peekaboo
    in the sandbox and do not fall back to the browser tools to fake desktop control.
Never
cd /vercel/sandbox
or assume a sandbox working directory — run
peekaboo
directly on the local shell.
Peekaboo用于控制用户的实体Mac,因此所有命令必须在local shell(Notis桌面桥接环境)中运行,绝不能在Vercel沙箱中执行。Shell调用默认使用
sandbox_shell
——若跳过此步骤,
peekaboo
命令会在
/vercel/sandbox
中运行,而Peekaboo在此环境中不存在,也无法控制Mac。
在执行任何
peekaboo
命令前,调用
set_shell_mode
并设置
mode: "local_shell"
  • 若调用成功,后续所有Shell命令都会在用户的Mac上运行,可继续操作。
  • "你的电脑"功能适用于所有套餐,包括免费版。若此调用意外返回
    entitlement_upgrade_required
    ,请报告权限策略不匹配问题并停止操作;不要引导用户升级至Ultra版。若返回
    entitlement_check_unavailable
    ,请告知用户重试。
  • 若返回错误提示Notis桌面应用未连接,请告知用户打开Notis桌面应用,并在设置中开启你的电脑(电脑使用权限),然后停止操作。请勿在沙箱中运行
    peekaboo
    ,也不要转而使用浏览器工具模拟桌面控制。
切勿执行
cd /vercel/sandbox
或默认使用沙箱工作目录——直接在local shell中运行
peekaboo

Peekaboo is already installed — do not install it

Peekaboo已预先安装——请勿自行安装

The Notis desktop app installs and manages a pinned Peekaboo for you (it's on your
PATH
) the moment the user enables computer use. So:
  • Do not run
    brew install
    , download releases, or check
    ~/bin/peekaboo
    .
  • Just run
    peekaboo …
    directly once you are on the local shell.
If
peekaboo --version
fails on the local shell, Peekaboo has not finished installing — tell the user to toggle Your Computer off and back on in the Notis desktop settings (which triggers the install), then retry. Do not try to install it yourself.
当用户启用电脑使用权限后,Notis桌面应用会自动为你安装并管理固定版本的Peekaboo(已添加至
PATH
)。因此:
  • 请勿执行
    brew install
    、下载安装包或检查
    ~/bin/peekaboo
  • 切换到local shell后,直接运行
    peekaboo …
    即可。
若在local shell中执行
peekaboo --version
失败,说明Peekaboo尚未完成安装——请告知用户在Notis桌面设置中先关闭再重新开启你的电脑权限(这会触发安装流程),然后重试。请勿尝试自行安装。

One plain command per call — no chaining

每次调用仅执行单个纯命令——不要链式调用

Run a single
peekaboo
invocation per shell call. Do not combine it with
&&
,
||
,
;
, pipes (
|
), redirects, or
cd
. Plain
peekaboo
commands auto-run on the local shell without an approval prompt; chained or piped commands lose that and get blocked or prompt the user. Parse output in a later step with
--json
instead of piping inline.
bash
undefined
每次Shell调用仅执行单个
peekaboo
命令。请勿使用
&&
||
;
、管道符(
|
)、重定向或
cd
进行组合。纯
peekaboo
命令会在local shell中自动运行,无需用户确认;而链式或管道命令会失去此特性,被拦截或需要用户确认。如需处理输出,请在后续步骤中使用
--json
参数,而非在命令中直接管道传输。
bash
undefined

Good — runs immediately:

正确——可立即运行:

peekaboo --version peekaboo see --json
peekaboo --version peekaboo see --json

Bad — chained/piped, will be blocked or prompt:

错误——链式/管道调用,会被拦截或需要确认:

~/bin/peekaboo --version || peekaboo --version peekaboo app list --json | python3 -c '...'
undefined
~/bin/peekaboo --version || peekaboo --version peekaboo app list --json | python3 -c '...'
undefined

Permissions Are Mandatory — Check Before Acting

权限是必需的——操作前务必检查

Peekaboo cannot capture or automate without macOS TCC grants. Always check permissions first and surface missing grants to the user; you cannot grant them programmatically.
bash
peekaboo permissions status --json
peekaboo permissions status --all-sources   # compare Bridge host vs local CLI
What each capability needs (System Settings → Privacy & Security):
  • Screen Recording → required for
    see
    ,
    image
    , and any capture. Enable the terminal/IDE/process that runs
    peekaboo
    . After a Homebrew upgrade, re-check that the enabled entry points at the current binary path.
  • Accessibility → required for clicks, typing, key presses, and window control. Enable the same terminals/IDEs.
  • Event Synthesizing
    peekaboo permissions request-event-synthesizing
    (add
    --no-remote
    to request it for the local CLI process). Enables process-targeted typing/hotkeys/paste without stealing focus.
If a needed grant is missing, tell the user exactly which toggle to flip and re-run
peekaboo permissions status --json
before continuing. Do not loop on failed captures.
没有macOS TCC权限,Peekaboo无法进行捕获或自动化操作。务必先检查权限,并告知用户缺失的权限;你无法通过编程方式授予权限。
bash
peekaboo permissions status --json
peekaboo permissions status --all-sources   # 对比桥接主机与本地CLI的权限
各功能所需的权限(系统设置 → 隐私与安全性):
  • 屏幕录制 → 执行
    see
    image
    及任何捕获操作必需。启用运行
    peekaboo
    的终端/IDE/进程。Homebrew升级后,请重新检查已启用的条目是否指向当前二进制文件路径。
  • 辅助功能 → 执行点击、输入、按键及窗口控制操作必需。启用相同的终端/IDE。
  • 事件合成 → 执行
    peekaboo permissions request-event-synthesizing
    (添加
    --no-remote
    可为本地CLI进程请求权限)。支持针对特定进程的输入/快捷键/粘贴操作,无需窃取焦点。
若缺少所需权限,请明确告知用户需要开启哪个开关,并让用户重新运行
peekaboo permissions status --json
后再继续操作。请勿循环尝试失败的捕获操作。

Remote / Background Sessions

远程/后台会话

On SSH, LaunchAgent, cron, or other background launchd sessions, prefer the Peekaboo Bridge path even when TCC appears granted — CoreGraphics can report success while returning only the desktop wallpaper or a redacted image. On remote Macs, Screen Recording may be blocked while clicks and typing still work through Accessibility; when the target UI is otherwise knowable, continue with clicks /
inspect-ui
instead of giving up.
在SSH、LaunchAgent、cron或其他后台launchd会话中,即使TCC权限已授予,也优先使用Peekaboo的Bridge路径——CoreGraphics可能会返回权限成功,但实际仅返回桌面壁纸或模糊后的图像。在远程Mac上,屏幕录制可能被拦截,但点击和输入仍可通过辅助功能正常工作;若目标UI已知,可继续使用点击/
inspect-ui
操作,无需放弃。

Start Here — Load The Live Tool Surface

入门——加载实时工具界面

Peekaboo's CLI is the source of truth for its own command surface; load it instead of guessing syntax (it matches the installed version):
bash
peekaboo learn          # full agent guide: system prompt, tool catalog, signatures
peekaboo tools          # MCP/agent tool catalog (supports --verbose, --json)
peekaboo <command> --help
Most commands support
--json
(alias
--json-output
) for machine parsing — prefer it when you need to act on the result. They share a snapshot cache, so capture once and reuse snapshot IDs.
Peekaboo的CLI是其命令界面的权威来源;请加载命令信息而非猜测语法(语法与已安装版本匹配):
bash
peekaboo learn          # 完整的Agent指南:系统提示、工具目录、签名信息
peekaboo tools          # MCP/Agent工具目录(支持--verbose、--json参数)
peekaboo <command> --help
大多数命令支持
--json
(别名
--json-output
)用于机器解析——当你需要基于结果执行操作时,优先使用此参数。这些命令共享快照缓存,因此只需捕获一次即可复用快照ID。

Core Loop: See → Act → Re-see

核心流程:查看 → 操作 → 重新查看

bash
undefined
bash
undefined

1. Capture an annotated UI map with element IDs (and a snapshot ID).

1. 捕获带元素ID的标注UI地图(及快照ID)。

peekaboo see --json
peekaboo see --json

2. Act on a target by element ID, query, or coordinates.

2. 通过元素ID、查询语句或坐标执行操作。

peekaboo click "Save" # by query/label peekaboo type "hello world" # send text peekaboo hotkey cmd,s # modifier combo in one shot
peekaboo click "Save" # 通过查询语句/标签点击 peekaboo type "hello world" # 输入文本 peekaboo hotkey cmd,s # 一次性发送组合快捷键

3. Re-capture before the next decision — IDs are per-snapshot and the screen

3. 执行下一个决策前重新捕获——元素ID仅对当前快照有效,每次操作后屏幕内容都会变化。

changes after every action.

peekaboo see --json

Re-`see` after navigation, dialogs, app switches, or any dynamic re-render.
Treat stale element IDs as invalid.
peekaboo see --json

导航、弹出对话框、切换应用或任何动态重渲染后,需重新执行`see`操作。过时的元素ID视为无效。

Clicking by coordinates needs
--foreground

通过坐标点击需添加
--foreground
参数

A bare
peekaboo click X,Y
(no target) is rejected:
Background click requires --app/--pid/--window-id or a snapshot; use --foreground
. So when you click a raw coordinate, focus the window first and pass
--foreground
:
bash
peekaboo window focus --app "Dia" --window-id 118166
peekaboo click --coords 672,607 --foreground
Prefer clicking by element ID/query when
see
/
inspect-ui
give you one. Use coordinates only when they don't (see next section).
直接执行
peekaboo click X,Y
(无目标)会被拒绝,提示:
Background click requires --app/--pid/--window-id or a snapshot; use --foreground
。因此,当你点击原始坐标时,需先聚焦窗口并添加
--foreground
参数:
bash
peekaboo window focus --app "Dia" --window-id 118166
peekaboo click --coords 672,607 --foreground
see
/
inspect-ui
返回元素ID/查询语句时,优先使用这些方式点击。仅当无法获取时,才使用坐标(见下一章节)。

Browser / web apps (Dia, Chrome, Safari, …): screenshot, don't inspect

浏览器/网页应用(Dia、Chrome、Safari等):截图,而非检查

Browsers usually expose no accessibility tree for their web content, so
see
and
inspect-ui
fail (
App '<X>' is running but has no windows or dialogs
, or return 0 elements) even though the page is visible. Do not loop on
see
/
inspect-ui
for web pages
— switch to vision:
  1. Capture the window:
    peekaboo image --app "Dia" --window-id <id> --mode window --path /tmp/shot.png --json
    (get
    <id>
    from
    peekaboo list windows --app "Dia" --json
    ).
  2. Locate the control visually in that screenshot.
  3. Convert to a screen coordinate: window-capture pixels map to global display points offset by the window's top-left origin (from the capture's
    bounds
    /
    list windows
    ). E.g. a window at origin
    (0,30)
    → image pixel
    (672,577)
    is screen point
    (672,607)
    .
  4. Focus the window and
    click --coords X,Y --foreground
    (above), then re-
    image
    to confirm the result changed.
Keyboard shortcuts like
space
do not reliably control web players (in a browser, space scrolls the page) — click the actual on-screen play/pause control instead.
浏览器通常不会为网页内容暴露无障碍树,因此即使页面可见,
see
inspect-ui
也会失败(提示
App '<X>' is running but has no windows or dialogs
,或返回0个元素)。请勿针对网页循环执行
see
/
inspect-ui
——改用视觉识别:
  1. 捕获窗口:
    peekaboo image --app "Dia" --window-id <id> --mode window --path /tmp/shot.png --json
    (从
    peekaboo list windows --app "Dia" --json
    获取
    <id>
    )。
  2. 在截图中视觉定位控件。
  3. 转换为屏幕坐标:窗口捕获的像素对应全局显示点,偏移量为窗口左上角原点(来自捕获的
    bounds
    /
    list windows
    结果)。例如,窗口原点为
    (0,30)
    → 图像像素
    (672,577)
    对应屏幕点
    (672,607)
  4. 聚焦窗口并执行
    click --coords X,Y --foreground
    (如上),然后重新执行
    image
    确认结果已变化。
space
等快捷键无法可靠控制网页播放器(在浏览器中,space键用于滚动页面)——请点击屏幕上的实际播放/暂停控件。

Command Map

命令映射

Run
peekaboo learn
/
peekaboo <command> --help
for authoritative flags.
  • Vision & capture:
    see
    (annotated UI map + snapshot IDs, optional AI analysis),
    image
    (raw PNG/JPG of screen/window/menubar,
    --analyze
    ),
    capture
    (live/long-running),
    list apps|windows|screens|menubar|permissions
    .
  • Interaction:
    click
    ,
    type
    (
    --clear
    ,
    --delay
    ),
    press
    ,
    hotkey
    ,
    paste
    (atomic clipboard set → Cmd+V → restore),
    scroll
    ,
    swipe
    ,
    drag
    ,
    move
    .
  • Windows / menus / apps / spaces:
    window
    (close/minimize/maximize/move/ resize/focus/list),
    space
    (list/switch/move-window),
    menu
    ,
    menubar
    ,
    app
    (launch/quit/relaunch/hide/switch/list,
    --open <url|path>
    ),
    open
    ,
    dock
    ,
    dialog
    (click/input/file/dismiss/list).
  • Automation & integration:
    agent
    (natural-language automation with dry-run planning + resume),
    inspect-ui
    (accessibility-tree inspection with no screenshot),
    run
    (
    .peekaboo.json
    scripts),
    sleep
    ,
    clean
    ,
    config
    ,
    daemon
    ,
    mcp
    .
For structured multi-step flows, orchestrate commands inside a
.peekaboo.json
script run via
peekaboo run --output ...
, rather than chaining many shell calls.
执行
peekaboo learn
/
peekaboo <command> --help
获取权威参数说明。
  • 视觉与捕获
    see
    (标注UI地图+快照ID,可选AI分析)、
    image
    (屏幕/窗口/菜单栏的原始PNG/JPG截图,支持
    --analyze
    )、
    capture
    (实时/长时捕获)、
    list apps|windows|screens|menubar|permissions
  • 交互操作
    click
    type
    (支持
    --clear
    --delay
    )、
    press
    hotkey
    paste
    (原子操作:设置剪贴板→Cmd+V→恢复原剪贴板)、
    scroll
    swipe
    drag
    move
  • 窗口/菜单/应用/空间
    window
    (关闭/最小化/最大化/移动/调整大小/聚焦/列出)、
    space
    (列出/切换/移动窗口)、
    menu
    menubar
    app
    (启动/退出/重启/隐藏/切换/列出,支持
    --open <url|path>
    )、
    open
    dock
    dialog
    (点击/输入/选择文件/关闭/列出)。
  • 自动化与集成
    agent
    (自然语言自动化,支持预演规划+恢复)、
    inspect-ui
    (无障碍树检查,无需截图)、
    run
    (运行
    .peekaboo.json
    脚本)、
    sleep
    clean
    config
    daemon
    mcp
对于结构化的多步骤流程,请通过
peekaboo run --output ...
运行
.peekaboo.json
脚本中的命令,而非链式调用多个Shell命令。

Safety Rules

安全规则

  • Never click, type, or destructively automate unless the user explicitly asked for that action or the target is a controlled test surface. Capturing and inspecting are read-only and safe; sending input is not.
  • Treat the screen as private. Do not exfiltrate screenshots or on-screen content beyond what the task requires, and do not capture and forward unrelated windows.
  • Avoid actions that trigger irreversible system dialogs (delete confirmations, purchases, sends) without explicit user confirmation. When in doubt, capture the dialog with
    peekaboo dialog list
    and ask before clicking.
  • Prefer
    --no-remote
    when testing local TCC behavior; use the Bridge path for background/remote captures.
  • 除非用户明确要求执行该操作,或目标是受控测试环境,否则切勿执行点击、输入或破坏性自动化操作。捕获和检查属于只读操作,是安全的;发送输入则并非如此。
  • 将屏幕内容视为隐私信息。请勿超出任务需要泄露截图或屏幕内容,也不要捕获并转发无关窗口。
  • 若操作会触发不可逆的系统对话框(删除确认、购买、发送等),请务必先获得用户明确确认。如有疑问,使用
    peekaboo dialog list
    捕获对话框并询问用户后再点击。
  • 测试本地TCC行为时,优先使用
    --no-remote
    参数;后台/远程捕获时使用Bridge路径。

Anti-Patterns

反模式

  • Do not run
    peekaboo
    before calling
    set_shell_mode
    with
    local_shell
    . The default
    sandbox_shell
    runs it in
    /vercel/sandbox
    , where Peekaboo does not exist — the command "fails" and looks like a permissions problem when it isn't.
  • Do not
    cd /vercel/sandbox
    (or any sandbox path) and do not assume a sandbox working directory. Run
    peekaboo
    directly on the local shell.
  • Do not install Peekaboo (no
    brew install
    , no downloads, no
    ~/bin
    probes). The Notis desktop app already installed and manages it on your
    PATH
    .
  • Do not chain
    peekaboo
    with
    &&
    ,
    ||
    ,
    ;
    , pipes, redirects, or
    cd
    . One plain command per call so it auto-runs without prompting.
  • Do not bare-coordinate-click (
    peekaboo click X,Y
    ) — it's rejected. Focus the window and use
    click --coords X,Y --foreground
    .
  • Do not loop on
    see
    /
    inspect-ui
    for a browser's web page (Dia, Chrome, Safari). They have no web accessibility tree — screenshot with
    image
    and target coordinates visually instead.
  • Do not rely on
    space
    /keyboard to play a web video — click the on-screen play control.
  • Do not skip the permissions check. A missing grant returns wallpaper-only or empty captures, not an obvious error.
  • Do not reuse element IDs across snapshots, or act without a fresh
    see
    .
  • Do not guess command syntax from memory — load
    peekaboo learn
    /
    --help
    for the installed version.
  • Do not send input to the user's machine on your own initiative. Read-only capture is the default; mutation needs an explicit request.
  • 请勿在调用
    set_shell_mode
    设置
    local_shell
    前运行
    peekaboo
    。默认的
    sandbox_shell
    会在
    /vercel/sandbox
    中运行该命令,而Peekaboo在此环境中不存在——命令会“失败”,且看起来像是权限问题,但实际并非如此。
  • 请勿执行
    cd /vercel/sandbox
    (或任何沙箱路径),也不要默认使用沙箱工作目录。直接在local shell中运行
    peekaboo
  • 请勿自行安装Peekaboo(不要执行
    brew install
    、下载安装包或检查
    ~/bin
    )。Notis桌面应用已预先安装并管理它,且已添加至
    PATH
  • 请勿使用
    &&
    ||
    ;
    、管道符、重定向或
    cd
    组合
    peekaboo
    命令。每次调用仅执行单个纯命令,以便自动运行无需用户确认。
  • 请勿直接点击坐标(
    peekaboo click X,Y
    )——这会被拒绝。请先聚焦窗口并使用
    click --coords X,Y --foreground
  • 请勿针对浏览器网页(Dia、Chrome、Safari)循环执行
    see
    /
    inspect-ui
    。它们没有网页无障碍树——改用
    image
    截图并通过视觉定位坐标。
  • 请勿依赖
    space
    /快捷键播放网页视频——点击屏幕上的播放控件。
  • 请勿跳过权限检查。缺失权限会仅返回壁纸或空捕获结果,而非明显的错误提示。
  • 请勿跨快照复用元素ID,或在未重新执行
    see
    的情况下执行操作。
  • 请勿凭记忆猜测命令语法——运行
    peekaboo learn
    /
    --help
    获取已安装版本的命令信息。
  • 请勿主动向用户的电脑发送输入。只读捕获是默认操作;修改操作需要用户明确请求。