microsoft/winappcli/winapp-ui-automation

Claude Code and agent skill by microsoft/winappcli

Trust tier 4
  • vendor
Source check pending

Checking that the SKILL.md file is still in the repository.

Inspect, drive, and verify a running Windows app UI via winapp ui (UI Automation): find elements, click, type, read text/values, wait for state, take screenshots in WinUI, WPF, WinForms, Win32, or Electron apps. Use to check, test, or act on a live app; for WinUI XAML internals, use winui-devtools.

Install

npx vskill@latest install microsoft/winappcli/winapp-ui-automation

SKILL.md

The same SKILL.md was published earlier as microsoft/winappcli/winapp-ui-automation.

If you can't run `winapp` yourself (no shell, or the command is denied), give the user the exact winapp command(s) for their project instead of only describing the steps.

When to use

  • Inspecting a running Windows app's UI from the command line
  • AI agents interacting with Windows applications (clicking buttons, reading text, taking screenshots)
  • Verifying UI state during development or testing
  • Automating UI workflows without Playwright or Selenium
  • Debugging WinUI 3, WPF, WinForms, Win32, or Electron app UIs by what the user sees and can operate
  • Not for a WinUI 3 app's XAML internals (why a value or binding resolved the way it did, which XAML line made an element, live property edits, UI review comments): use winui-devtools

Prerequisites

For WinUI 3 XAML source/tree, bindings or dependency-property diagnosis and edits, use the winui-devtools skill and winapp devtools. It requires an attached target or explicit authorization to inject with --attach; a PID alone is not consent. An AutomationId works as a selector in both tools; generated slugs do not transfer to DevTools. Continue using winapp ui for cross-framework actions, screenshots, waits and accessibility.

To measure WinUI work while driving a scenario, use the winapp-performance skill to bracket UI actions with capture markers.

  • For UIA mode (any app): No setup needed — works with any running Windows app
  • For input-injecting verbs (click, hover, drag, touch, pen, scroll --wheel/--wheel-horizontal, send-keys --via send-input): an unlocked, interactive desktop with the target window foregroundable. On a locked/secure desktop they fail fast with no_interactive_desktop. The UIA-pattern verbs (inspect, search, get-*, wait-for, set-value, invoke, scroll --direction/--to) are headless/locked-session friendly — prefer them in CI.
  • screenshot is not in that group: it always takes an exclusive turn, so it queues behind other UI workflows, and capture can need a usable interactive desktop — the engine restores the target if it is minimized, and falls back to foregrounding it when frame capture is unavailable or --capture-screen is used.
  • --capture-screen needs exactly one window. -w <hwnd> gives it one: that window's screen region, including anything visibly on top of it. If -a matches several top-level or owned windows the command fails with invalid_arguments before capturing; run winapp ui list-windows -a <app> and retry with -w <hwnd>.
  • If other UI workflows may run at the same time, set one workflow id per logical workflow (see below). Nothing breaks without it, but your commands will not be recognized as belonging together.

Coordinating with other UI workflows

Windows has one foreground window, one keyboard focus, one cursor, and one input stream. winapp ui therefore makes desktop-driving commands take cooperative turns so concurrent workflows cannot steal each other's focus or dismiss each other's menus. That is always on. Read-only commands never wait.

Keeping the desktop across commands is opt-in — without an id, each command is a one-shot that releases the desktop the moment it finishes:

powershell
# Set once per logical UI workflow — same value for cooperating calls, different values for
# independent workflows (even from the same agent).
$env:WINAPP_UI_WORKFLOW_ID = [guid]::NewGuid().ToString()

Rules that matter when driving this from an agent:

  • Each tool call usually gets a fresh shell, and there is no process-ancestry fallback, so

commands are grouped ONLY by the id you inject. Without it every call is its own workflow.

  • A workflow with an id keeps its turn for four seconds after its last command. That covers

back-to-back commands in one script; it deliberately expires while you are reasoning. Treat it as a fallback for when you cannot say you are done — not as the way to finish.

  • Run `winapp ui yield` when you finish a known sequence. It hands the desktop over immediately

instead of making a waiting workflow sit out a four-second grace nobody needs. Yielding twice, or after the grace lapsed, is a harmless success.

  • After a reasoning gap, replay your setup. Another workflow may have used the desktop, so

reopen the menu / re-navigate, re-resolve the element, then act. Do not assume transient UI survived.

  • Prefer one tight script over many round trips for a known sequence: `winapp ui invoke View -w

$hwnd; winapp ui search "Status bar" -w $hwnd; winapp ui click "Status bar" -w $hwnd; winapp ui yield`.

  • `record` shares the turn with its own workflow, so same-workflow clicks and typing are captured

while it runs — but only if both commands carry the same id. A record with no id blocks everyone else for its whole duration.

  • Ordering is owner affinity, then FIFO. An active workflow may keep issuing commands ahead of

others already waiting; once it yields or its grace expires, waiters are served in arrival order.

  • Waiting is indefinite and cancellable. After one second a notice on stderr says what holds the

desktop and for how long (silent under --json and --quiet); Ctrl+C exits 130 with error code cancelled and the command never ran.

  • There is no hard cap — a long script, unbounded recording, or failure loop can block other

mutating workflows until it finishes or is stopped.

Commands that never wait: status, list-windows, inspect, search, get-*, wait-for. Commands that wait for the turn but never take the desktop (headless/locked-session friendly): set-value, scroll-into-view, scroll --direction/--to, record. They mutate the app, so they queue behind another workflow. Inside your own workflow they overlap with other shared work — that is how record captures the set-value calls it is recording — but they still wait behind an earlier DesktopExclusive command of your own workflow, so a click followed by a set-value runs in the order you wrote it. Commands that take the desktop exclusively: invoke, click, drag, hover, scroll --wheel/--wheel-horizontal, touch, pen, focus, send-keys, screenshot.

powershell
# Finish a workflow deliberately rather than leaving the desktop reserved for four more seconds.
winapp ui yield

Common patterns

Read within a specific container
powershell
winapp ui search "Welcome to MyApp" -a myapp --root MailRow --type Text --class-name TextBlock
winapp ui get-value Subject -a myapp --root MailRow --type TextBox
winapp ui wait-for Subject -a myapp --root MailRow --type Edit --value Ready --timeout 10000
winapp ui search --class-name CalendarSurface -a myapp # no text selector needed

Use --root, --type, and --class-name together or separately on search, get-property, get-value, wait-for, and the commands that act on one selected element (invoke, set-value, click, focus, and so on; not send-keys --target). --type and --class-name work without a selector; commands other than search then need exactly one match, and an ambiguous match lists the first five with their slugs. --root alone is not a query. For set-value, pass "" as the selector. For click, hover, touch, and pen, filters can't be combined with --at or --path. The root must be unique; only its descendants match. wait-for re-resolves it every poll, including when it is initially absent. Type names and literal whole ClassName values ignore case. The only type aliases are TextBox → Edit and TextBlock → Text. See Scoped and typed queries for the full type vocabulary, boundaries, and error behavior.

Discover and interact
powershell
# See what's clickable, then screenshot for context
winapp ui inspect -a myapp --interactive; winapp ui screenshot -a myapp
# Click and verify the page changed
winapp ui invoke btn-settings-a1b2 -a myapp; winapp ui wait-for pn-settingspage-c3d4 -a myapp --timeout 3000; winapp ui screenshot -a myapp
# Fill a form and submit
winapp ui set-value txt-searchbox-e5f6 "hello" -a myapp; winapp ui invoke btn-submit-7a90 -a myapp; winapp ui screenshot -a myapp
Find visible text and click it
powershell
# Search by text — output shows invokable ancestor
winapp ui search "Save changes" -a myapp
# Output:
# lbl-savechanges-a1b2 "Save changes" (120,40 80x20)
# ^ invoke via: btn-save-c3d4 "Save"
# Invoke by text — auto-walks to parent Button
winapp ui invoke 'Save changes' -a myapp
Navigate multi-page apps
powershell
# Click nav item, wait for page, inspect what's available
winapp ui invoke itm-samples-3f2c -a myapp; winapp ui wait-for pn-samplespage-b4e7 -a myapp; winapp ui inspect -a myapp --interactive
Choose an exact action in tests
powershell
winapp ui invoke SettingsCategory -a myapp --action select
winapp ui invoke AgreeCheckbox -a myapp --action toggle-on --json
winapp ui invoke Open -w <dialog-HWND> --type Button --action invoke

Use --action to avoid automatic pattern and ancestor fallback. Omit it for the existing automatic behavior. With --root, --type, or --class-name, the filters follow the same matching rules as read queries: exactly one element must match inside the selected app/window, or the command fails without acting, and the ancestor fallback is skipped. See the action reference for supported actions, scope, idempotent toggles, and failure recovery, and the JSON envelope for action results.

Disambiguate duplicate elements
powershell
# Text matches by substring, but an element named exactly the text wins
winapp ui invoke Submit -a myapp # acts on Button "Submit", not Button "Submit Order"
# When several elements share that name, the error shows slugs for each — pick the right one
winapp ui invoke Save -a myapp
# → Selector matched 2 elements:
# [0] Button "Save" → btn-save-a1b2
# [1] Button "Save" → btn-save-c3d4
# Use the slug: winapp ui invoke btn-save-c3d4 -a myapp

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 24 Nov 2026.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
1,290
Repository forks
84
7-day trend score
36

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill CERTIFIED badge
[![vskill CERTIFIED](https://verified-skill.com/api/v1/skills/microsoft/winappcli/winapp-ui-automation/badge)](https://verified-skill.com/skills/microsoft/winappcli/winapp-ui-automation)

Something wrong with this skill or its page? Tell us.