# Cua Driver

Drive a native GUI app (macOS, Windows, Linux) via the Qwen Cua Driver CLI (default) or...

- Repository: https://github.com/QwenLM/qwen-code (28858 stars)
- Category: Design
- License: Apache-2.0
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add QwenLM/qwen-code --skill cua-driver -g -a claude-code -y`
Codex: `npx skills add QwenLM/qwen-code --skill cua-driver -g -a codex -y`
Cursor: `npx skills add QwenLM/qwen-code --skill cua-driver -g -a cursor -y`
Gemini CLI: `npx skills add QwenLM/qwen-code --skill cua-driver -g -a gemini-cli -y`

## Description

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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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:

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