跳到正文
Skillpedia
智能体29k · #9791

cua-driver

它能做什么

它指导智能体使用一个读取应用界面的驱动工具,在 macOS、Windows 或 Linux 上操作桌面应用。适合希望 AI 智能体在真实应用中完成任务的人。

适用场景

  • ✓当你要求智能体在桌面应用内操作或自动化某项任务时。
  • ✓当你希望读取并使用应用界面来完成多步骤任务时。
  • ✓当任务需要在一个没有 API 的应用中进行点击和输入时。

技能链接

https://github.com/QwenLM/qwen-code/blob/main/packages/cua-driver/rust/Skills/cua-driver/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/QwenLM/qwen-code/blob/main/packages/cua-driver/rust/Skills/cua-driver/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请打开我的电子表格应用,找到每月合计的标签页,并为我导出为 PDF。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体对应用界面拍摄快照,根据该快照中的元素或精确的位置进行操作,然后通过一张新的快照检查结果。它每次都遵循同样的循环,以免操作失去同步。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Qwen Cua Driver

Orchestrates cross-platform app automation via qwen-cua-driver. Whenever a user asks to drive a native app, follow the loop in this skill rather than calling tools ad-hoc — the snapshot-before-action invariant is not optional and silently breaks if you skip it.

Platform-specific reading — read this first

This file is the cross-platform core: snapshot invariant, CLI vs MCP choice, tool surface naming, behavior matrix, canonical loop, pixel-click contract, common failure modes. The platform-specific material (forbidden-list, accessibility tree implementation, launch semantics, click dispatch) lives in companion files in this same directory:

  • macOS — read MACOS.md (no-foreground contract, forbidden open/osascript/cliclick invocations, AXMenuBar navigation, SkyLight pixel-click dispatch).
  • Windows — read WINDOWS.md (UIA tree vs AX, UWP / ApplicationFrameHost hosting, layered UIA+PostMessage click chain, Session 0 isolation, Windows-specific focus-steal vectors).
  • Linux — read LINUX.md (X11 background input via AT-SPI + XSendEvent (including X11 apps under XWayland)).

Cross-cutting topics also have their own files:

  • BROWSER.md — exact native-window binding, explicit browser preparation, typed Chromium/Electron page tools, input trust classes, and native fallbacks for browser chrome and unsupported engines.
  • RECORDING.md — session recording + replay_trajectory.

Use whichever combination matches the host. When in doubt, run qwen-cua-driver doctor — it reports the platform and the right entry point.

Start with the narrowest semantic route

Before opening or operating an application, name the desired postcondition and use the first applicable route below. Verify the result in the same domain before stopping or advancing:

  1. Caller-provided headless/background operation for a non-GUI outcome. Prefer an exact application API/SDK, service or database client, CLI, or filesystem operation over imitating a user. This includes batch-safe file moves, renames, copies, directory creation, archive extraction, data conversion, and process inspection. Read the resulting semantic state back; a zero exit status alone is not proof.
  2. Typed Cua operation for an application or window outcome. Use set_window_frame for exact geometry, invoke_menu for a known native application-menu path, typed browser tools for supported page content, and clipboard tools for clipboard state. Verify with list_windows, get_browser_state, or clipboard_read, respectively.
  3. Background accessibility action. Use a fresh AX/UIA/AT-SPI target.
  4. Background pixel action. Use the pixels from the same state snapshot.
  5. Foreground delivery. Retry only the action that evidence says could not land in the background.
  6. Desktop fallback. Select an exact desktop target for that call only. Later calls may return to an exact window target in the same session.

Use Cua Driver when the outcome lives in an application's UI or window state, or when the user explicitly asks to operate that GUI. Once the task crosses that boundary, do not replace Cua's targeted and verified actions with shell scripts that mutate the app UI. A shell is a capability of the calling agent, not of the Cua Driver MCP server; an MCP-only client must not assume one exists.

Filesystem outcomes and GUI fallbacks

When the requested outcome is a filesystem change and the caller has a headless filesystem or command capability, keep it on rung 0. Enumerate the exact source set, decide the destination-conflict policy before changing anything, perform one batch-safe operation, then independently read back both source and destination manifests. Do not open a file manager merely to mimic a move, copy, or rename that the caller can execute and verify directly.

If the caller has no such capability, use the file manager as a GUI fallback and keep each claim narrow:

  1. After entering an inline rename and setting its value, commit it with the platform's confirmation key, then take a fresh snapshot. Value readback from the inline editor proves only that the editor changed; it does not prove the filesystem rename committed.
  2. For a multi-selection, use the platform modifier (cmd on macOS, ctrl on Windows/Linux). On macOS and Windows, issue that modified click with delivery_mode:"foreground" so the target observes physical modifier state;
常见问题

它支持哪些操作系统?

macOS、Windows 和 Linux,并在单独的文件中提供特定平台的说明。

为什么每次操作前都要拍摄快照?

没有最新快照,点击可能会悄悄落在错误的元素上。

它也能在网页浏览器中工作吗?

浏览器相关的工作有同一技能内的配套指导。

详情

作者的原始描述

Drive a native GUI app (macOS, Windows, Linux) via the Qwen Cua Driver CLI (default) or MCP server; snapshot its accessibility tree, act through snapshot-bound element tokens, native menu paths, exact window geometry, or pixel coordinates, and verify from fresh state. Use when the user asks you to operate, drive, automate, or perform a GUI task in a real application on the host.

repo: QwenLM/qwen-code

热度

GitHub 星标
29k
排名
#9791
许可证
Apache-2.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能