简介
agent-desktop
原始描述
Desktop automation via native OS accessibility trees using the agent-desktop CLI. Use when an AI agent needs to observe, interact with, or automate desktop applications (click buttons, fill forms, navigate menus, read UI state, toggle checkboxes, scroll, drag, type text, take screenshots, manage windows, use clipboard, manage notifications). Covers 58 command names (54 operational; four held-input names fail closed until daemon ownership exists) across observation, interaction, keyboard/mouse, app lifecycle, notifications (macOS), clipboard, wait, session lifecycle, and a `skills` command that bundles docs straight from the binary. Triggers on: "click button", "fill form", "open app", "read UI", "automate desktop", "accessibility tree", "snapshot app", "type into field", "navigate menu", "toggle checkbox", "take screenshot", "desktop automation", "agent-desktop", or any desktop GUI interaction task. Supports the macOS Phase 1 adapter, with Windows and Linux planned against the same core contracts.
通过你的 Agent 添加
安装目录:agent-desktop/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
name: agent-desktop
description: Use the built-in Computer sub-agent with agent-desktop for macOS desktop automation. Apply when a task needs application launching, accessibility snapshots, stable element refs, window focusing, semantic clicks/typing, or visual confirmation outside the browser sandbox.
agent-desktop
Use this skill when the task involves the host macOS desktop rather than repository files, shell output, or browser-only verification.
This project uses agent-desktop on the host. Prefer the built-in Computer sub-agent for these tasks instead of trying to drive the desktop with plain shell commands.
When to use it
- The user wants to inspect or interact with a native macOS application.
- The task needs app launch, window focus, accessibility snapshots, semantic element refs, clicks, typing, keypresses, or scrolling.
- A browser-only workflow is not enough, or the target is not a web page.
Requirements
agent-desktop must be installed and its native binary available.
- On macOS, the terminal app running
grok needs Accessibility permission.
- Refs from
computer_snapshot are only valid until the next snapshot.
Preferred flow
- Delegate to
task with agent: "computer" unless the current agent already has the computer_* tools and the task is tiny.
- Use
computer_launch, computer_list_windows, or computer_focus_window to get the target app/window ready.
- Start with
computer_snapshot.
- Pick one ref-based action.
- After any UI transition, snapshot again before reusing refs.
Tool guidance
computer_snapshot: primary observation tool; prefer interactive_only.
computer_click: use ref values from the latest snapshot whenever possible.
computer_type: requires a target ref and is preferred over coordinate typing.
computer_press: use for shortcuts and special keys such as Enter, Tab, cmd+space, or cmd+k.
computer_scroll: pass an element ref, not raw coordinates.
computer_get: read text, value, bounds, role, or states from a ref.
computer_screenshot: use for visual confirmation or when the accessibility tree is not enough.
Reliability rules
- Use a snapshot -> act -> snapshot loop.
- Prefer refs over coordinates.
- Refs go stale after the next snapshot; do not reuse them blindly.
- Keep actions reversible and low risk unless the user explicitly asked for something destructive.
- If the accessibility tree is poor or ambiguous, use
computer_screenshot for confirmation and explain the limitation.
Blockers
agent-desktopmust be installed and its native binary available.- On macOS, the terminal app running
grokneeds Accessibility permission. - Refs from
computer_snapshotare only valid until the next snapshot.
Preferred flow
- Delegate to
task with agent: "computer" unless the current agent already has the computer_* tools and the task is tiny.
- Use
computer_launch, computer_list_windows, or computer_focus_window to get the target app/window ready.
- Start with
computer_snapshot.
- Pick one ref-based action.
- After any UI transition, snapshot again before reusing refs.
Tool guidance
computer_snapshot: primary observation tool; prefer interactive_only.
computer_click: use ref values from the latest snapshot whenever possible.
computer_type: requires a target ref and is preferred over coordinate typing.
computer_press: use for shortcuts and special keys such as Enter, Tab, cmd+space, or cmd+k.
computer_scroll: pass an element ref, not raw coordinates.
computer_get: read text, value, bounds, role, or states from a ref.
computer_screenshot: use for visual confirmation or when the accessibility tree is not enough.
Reliability rules
- Use a snapshot -> act -> snapshot loop.
- Prefer refs over coordinates.
- Refs go stale after the next snapshot; do not reuse them blindly.
- Keep actions reversible and low risk unless the user explicitly asked for something destructive.
- If the accessibility tree is poor or ambiguous, use
computer_screenshot for confirmation and explain the limitation.
Blockers
task with agent: "computer" unless the current agent already has the computer_* tools and the task is tiny.computer_launch, computer_list_windows, or computer_focus_window to get the target app/window ready.computer_snapshot.computer_snapshot: primary observation tool; preferinteractive_only.computer_click: userefvalues from the latest snapshot whenever possible.computer_type: requires a target ref and is preferred over coordinate typing.computer_press: use for shortcuts and special keys such asEnter,Tab,cmd+space, orcmd+k.computer_scroll: pass an element ref, not raw coordinates.computer_get: read text, value, bounds, role, or states from a ref.computer_screenshot: use for visual confirmation or when the accessibility tree is not enough.
Reliability rules
- Use a snapshot -> act -> snapshot loop.
- Prefer refs over coordinates.
- Refs go stale after the next snapshot; do not reuse them blindly.
- Keep actions reversible and low risk unless the user explicitly asked for something destructive.
- If the accessibility tree is poor or ambiguous, use
computer_screenshot for confirmation and explain the limitation.
Blockers
computer_screenshot for confirmation and explain the limitation.Stop and report clearly if:
- Accessibility permission is missing.
agent-desktopis unavailable or its native binary is missing.- The target app/window cannot be found.
- Refs are stale or ambiguous after a UI transition.
- The requested action could be destructive and the user did not explicitly ask for it.