agent-desktop-windows
它能做什么
为助手提供通过 agent-desktop 工具控制 Windows 桌面应用的指南。适合希望助手在 Windows 程序中读取和点击内容的人。
适用场景
- ✓当你希望助手在 Windows 应用中点击、输入或读取内容时。
- ✓当 Windows 自动化命令没有返回结果,或漏掉了某个窗口时。
- ✓当你需要知道哪些自动化命令可以在 Windows 上使用时。
技能链接
https://github.com/NanmiCoder/cc-haha/blob/main/native/agent-desktop/skills/agent-desktop-windows/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“你能在我的 Windows 电脑上打开记事本,输入一段简短的备注,然后保存吗?”
每周 5 个新技能,1 分钟读完。
工作原理
指南会说明每组命令在 Windows 上的作用,以及首次运行时常见的问题。助手会使用桌面无障碍树找到控件、对其进行操作,并检查结果。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
agent-desktop-windows
The observe-act loop, ref system, JSON envelope, sessions and tracing are the same on every platform. This file covers only what differs on Windows.
Requires Windows 10 1809+ / Windows Server 2019+ (x64 or ARM64). Run it in the interactive desktop session of the signed-in user. Session 0 (services and SYSTEM tasks), Server Core, the secure desktop (UAC prompts, the sign-in screen), a locked desktop and another user's session are not supported: observation, actions and capture there fail or return nothing.
Capability Table
| Group | Commands | Status on Windows |
|---|---|---|
| Observation | snapshot, find, get, is, screenshot |
Works. Surfaces are window, focused, a Chromium modal as sheet, and an open application menu as menu |
| Surfaces | list-surfaces |
Works. Lists window, focused and sheet per process, plus menu with item_count while a menu is open |
| Shell surfaces | open-system-surface |
Works for start-menu, taskbar, system-tray, system-tray-overflow and action-center, and returns the window snapshot --surface <kind> reads. quick-settings returns PLATFORM_NOT_SUPPORTED naming action-center |
| Ref interaction | click, right-click, type, set-value, clear, select, toggle, check, uncheck, expand, collapse, scroll, scroll-to |
Works, semantic in headless and --headed mode. right-click and type need --headed and return POLICY_DENIED headless |
| Multi-click and focus | double-click, triple-click, focus |
Works with global --headed only |
| Keyboard and mouse | press, hover, drag, mouse-click, mouse-move, mouse-wheel |
Works. Cursor-moving input needs --headed. First Contact covers press --app |
| Held input | key-down, key-up, mouse-down, mouse-up |
Fails closed on every platform with ACTION_NOT_SUPPORTED. A headless mouse-down or mouse-up returns POLICY_DENIED first |
| App and window | launch, close-app, list-windows, list-apps, focus-window, resize-window, move-window, minimize, maximize, restore |
Works. First Contact covers the name launch takes |
| Displays | list-displays |
Works |
| Clipboard | clipboard-get, clipboard-set, clipboard-clear |
Works; typed text and image content |
| Wait | wait |
Works for ms, --element, --window, --text, --menu, --menu-closed, --event and --notification |
| Notifications | list-notifications, dismiss-notification, dismiss-all-notifications, notification-action |
Works over the Action Center. Pass --headed when the center is closed |
| Cursor overlay | cursor-overlay |
Works. enable returns data.rendered: true only after the renderer acknowledges over its pipe. See references/shell-and-overlay.md |
| System | status, permissions, version, batch, skills, session, trace |
Works |
First Contact
- Quote every ref in PowerShell. PowerShell reads a bare
@tokenas its splatting operator and deletes the argument before the binary sees it, soset-value @s8f3k2p9:e1 hifailsINVALID_ARGS. Writeset-value '@s8f3k2p9:e1' hi. cmd.exe and bash need no quoting. - A window behind another window is drivable. A minimized one is not.
Every element of a minimized window reports
offscreenand ref actions fail. Runrestore --app <image>and snapshot again. Do not usefocus-windowby reflex: it steals the user's foreground. - No permission dialog exists.
permissionsreportsautomationasnot_required. Elevation boundaries are the only access control. - Chromium and Electron apps read thin before they settle. Pass a longer
--timeout-mstosnapshotinstead of concluding the tree is empty. - Blocked shortcuts.
alt+f4,win+l,win+d,alt+tab,win+r,win+x,win+e,ctrl+shift+escand their modifier supersets are refused without--force. In combos,cmdandmetaare the Windows key, someta+cis a shell shortcut. Writectrl+cto copy. typeneeds--headed. It is keystroke synthesis throughSendInput, so a strict-headlesstypereturnsPOLICY_DENIED. Useset-value, or pass--headed. It endsdelivered_unverified(verification_scope: "unavailable") when the field exposes no readable Text selection, and can verify when one is readable: confirm with a freshget.press --appwrites to the foreground queue with no per-
常见问题
支持哪些 Windows 版本?
指南说明支持 Windows 10 1809 版或更高版本,或 Windows Server 2019 或更高版本,适用于 x64 或 ARM64。
为什么助手在某些窗口上会失败?
安全桌面(例如 UAC 提示、登录屏幕和锁定的桌面)不受支持,因此在这些位置自动化会失败。
PowerShell 中引号重要吗?
重要。元素引用必须加引号,因为 PowerShell 会把裸露的 at 符号当作运算符。
详情
作者的原始描述
Windows platform guide for the agent-desktop CLI. Lists per command group what works on Windows and what refuses, the first-contact gotchas (PowerShell ref quoting, minimized windows, headed-only input), and where to find shell surfaces, notifications, the cursor overlay, UIPI elevation, Chromium/Electron settle behavior and troubleshooting. Triggers on: "windows desktop automation", "UIA tree", "automate Windows app", "agent-desktop on Windows", "elevated window input blocked", "E_ACCESSDENIED", or any Windows GUI interaction task.
repo: NanmiCoder/cc-haha
热度
- GitHub 星标
- 15k
- 排名
- #10916
- 许可证
- —
- 更新时间
- 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-macos
15k教你的智能体如何自动化 Mac 应用,包括授予所需权限,以及处理菜单、对话框和 Chromium 或 Electron 应用。
agent-desktop
15k让你的智能体通过读取无障碍树、点击、输入并检查结果,在 Mac、Windows 或 Linux 上查看和操作桌面应用。