agent-desktop-macos
它能做什么
为助手提供通过 agent-desktop 工具控制 Mac 应用的指南。适合希望助手在 macOS 应用中点击和读取内容的人。
适用场景
- ✓当你希望助手在你的 Mac 上点击、输入或读取应用内容时。
- ✓当 Mac 自动化因权限错误或空的无障碍树而失败时。
- ✓当你需要在 macOS 上处理 Chromium 或 Electron 应用时。
技能链接
https://github.com/NanmiCoder/cc-haha/blob/main/native/agent-desktop/skills/agent-desktop-macos/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我设置 Mac,让你能替我点击“设置”应用,并告诉我你需要哪些权限。”
每周 5 个新技能,1 分钟读完。
工作原理
指南会引导你在系统设置中检查权限,然后使用该工具观察屏幕并操作控件。它也涵盖菜单、对话框,以及 Chromium 或 Electron 应用。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
agent-desktop on macOS
Read the core skill first (agent-desktop skills get desktop) for the observe, act, verify loop. This skill covers only what is different on macOS. Symptoms and fixes are in references/troubleshooting.md.
Requirements
- macOS 13 or later, Intel or Apple Silicon.
- Accessibility permission for the app that launches agent-desktop (Terminal, iTerm2, Warp, VS Code, Codex). macOS 27 and later name this list Device Control and Data Access. If System Settings lists the
agent-desktopbinary separately, grant it too. - Screen Recording permission, only for
screenshotand forsession start --screenshotsartifacts. - Automation permission for System Events, only where a command reports it missing.
First contact
- Run
agent-desktop permissions. - If a permission is denied, run
agent-desktop permissions --guide. It opens the correct System Settings page with a panel that shows the user which app to drag into the list. The user confirms with Touch ID or a password, and the panel moves to the next missing permission by itself. The command returns at once with"guide": "started","already_running"or"not_needed".agent-desktop permissions --requestshows the system prompts instead. - If the guide cannot run, open System Settings > Privacy & Security > Accessibility (Device Control and Data Access on macOS 27 and later). Add the launching app and turn it on.
- Run
agent-desktop permissionsto confirmgranted. The next agent-desktop call sees a new grant, so the launching app does not need a restart. - Run
agent-desktop snapshot -ito confirm. It reads the focused app.snapshot --app Finder -ireturnsWINDOW_NOT_FOUNDwhen Finder has no open window.
permissions does not prompt. permissions --request can prompt, including for Automation. permissions --guide does not prompt and covers Accessibility and Screen Recording only. Automation reports unknown when macOS would need to prompt.
What differs on macOS
Headed is physical first for click, right-click, type, clear and scroll. Core focuses the exact window of the ref. The adapter then sends a real click, key or wheel event to the verified point. expand, collapse, set-value, select, toggle, check, uncheck, focus and scroll-to stay semantic under --headed. Double-click, triple-click, hover and drag need --headed. Raw --xy input never changes focus.
Judge delivery by observation. AX return codes do not prove an effect. Finder returns success from an AXConfirm that does nothing. Snapshot again or use get and is to check the result.
Surfaces. Use --surface menubar for File, Edit and View menus and for menu bar apps (status items). While a menu, sheet, alert or popover is open, refs from the window tree behind it are the wrong target.
Menus. right-click headless uses AXShowMenu. If the menu opened but the app returned APP_UNRESPONSIVE with retry: unsafe, do not retry. Inspect the menu with --surface menu. For combo boxes and menu buttons, use select @ref "Option". select needs a closed-to-open menu transition, so dismiss any open menu first.
Notification Center. The notification commands drive Notification Center through accessibility, with the rules in the core commands-system reference. When agent-desktop opens the center, it closes it afterwards and restores the previous app focus. Pass both --expected-app and --expected-title on a single dismiss or action, because the stack shifts. Use wait --notification --app "App" for banners that vanish before you list them.
Chromium and Electron. agent-desktop switches on the web accessibility of a Chromium renderer automatically when it needs it. For a dense running app, use snapshot --skeleton -i --compact, then drill with --root @ref.
Identity. launch accepts a display name ("System Settings") or a bundle ID (com.apple.systempreferences). Other commands take the display name through --app. Window IDs such as w-4521 stay valid for the life of the window. Find them with list-windows.
Keys. The primary modifier is cmd: press cmd+c, press cmd+s. Quit shortcuts such as cmd+q, cmd+shift+q, cmd+alt+esc, ctrl+cmd+q and cmd+shift+delete return POLICY_DENIED unless you pass --force. To quit an app, use close-app. Punctuation keys work in combos, as the symbol (, . / ; ' [ ] \ - =
常见问题
它需要哪些权限?
需要启动该工具的应用拥有辅助功能权限。只有截图时才需要屏幕录制权限。
助手能替我授予权限吗?
它可以通过指南打开正确的系统设置页面,但你需要自己使用触控 ID 或密码确认更改。
支持哪些 macOS 版本?
指南说明支持 macOS 13 或更高版本,包括 Intel 和 Apple Silicon 的 Mac。
详情
作者的原始描述
macOS platform guide for the agent-desktop CLI. Use for desktop automation on macOS: granting Accessibility and Screen Recording permission (TCC), what headed mode does on macOS (physical-first click, type and scroll), surfaces (menu, menubar, sheet, popover, alert), Notification Center, Chromium and Electron apps including launch --cdp, and fixing PERM_DENIED, empty accessibility trees, ACTION_FAILED and APP_UNRESPONSIVE.
repo: NanmiCoder/cc-haha
热度
- GitHub 星标
- 15k
- 排名
- #10915
- 许可证
- —
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-desktop-ffi
15k帮助开发者直接从 Python、Swift、Node、Go 或 C++ 调用 agent-desktop 自动化库,无需为每个操作都启动命令行工具。
agent-desktop-linux
15k教你的智能体如何使用 agent-desktop 控制 Linux 桌面应用,包括在 X11 和 Wayland 上哪些功能可用,以及常见的首次运行问题修复方法。
agent-desktop-windows
15k教你的智能体如何自动化 Windows 应用,涵盖哪些功能可用、PowerShell 引号的用法、最小化窗口以及提权应用的限制。
agent-desktop
15k让你的智能体通过读取无障碍树、点击、输入并检查结果,在 Mac、Windows 或 Linux 上查看和操作桌面应用。