diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index a490ef54e..eaa543cdc 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -4,23 +4,28 @@ "name": "Microsoft", "url": "https://github.com/microsoft/WinAppCli" }, - "description": "Windows app development, packaging, and distribution. Helps with creating Windows installers (MSIX), code signing, certificates, Windows SDK and Windows App SDK setup, package identity for Windows APIs (push notifications, background tasks, share target), appxmanifest authoring, and Microsoft Store distribution. Supports Electron, .NET, C++, Rust, Flutter, and Tauri apps.", + "description": "Agent plugin for developing Windows apps with the winapp CLI. Scaffold WinUI/XAML apps, find WinUI controls and Windows APIs, inspect and automate desktop app UIs, configure Windows SDK and Windows App SDK access, and package, sign, and distribute apps with MSIX. Supports WinUI, Electron, .NET (WPF, WinForms, and MAUI), C++, Rust, Flutter, and Tauri.", "version": "0.6.3", "plugins": [ { "name": "winappcli", - "description": "Windows app development, packaging, and distribution. Helps with creating Windows installers (MSIX), code signing, certificates, Windows SDK and Windows App SDK setup, package identity for Windows APIs (push notifications, background tasks, share target), appxmanifest authoring, and Microsoft Store distribution. Supports Electron, .NET, C++, Rust, Flutter, and Tauri apps.", + "description": "Agent plugin for developing Windows apps with the winapp CLI. Scaffold WinUI/XAML apps, find WinUI controls and Windows APIs, inspect and automate desktop app UIs, configure Windows SDK and Windows App SDK access, and package, sign, and distribute apps with MSIX. Supports WinUI, Electron, .NET (WPF, WinForms, and MAUI), C++, Rust, Flutter, and Tauri.", "version": "0.6.3", "source": "./plugins/winapp", "category": "windows-development", "tags": [ "windows", + "winui", + "xaml", "msix", "packaging", "installer", "desktop", "notifications", "sdk", + "scaffolding", + "ui-automation", + "windows-app-sdk", "signing", "certificate", "distribution" diff --git a/.github/plugin/marketplace.json b/.github/plugin/marketplace.json index 358fc4005..587e11322 100644 --- a/.github/plugin/marketplace.json +++ b/.github/plugin/marketplace.json @@ -5,13 +5,13 @@ "url": "https://github.com/microsoft/WinAppCli" }, "metadata": { - "description": "Windows app development, packaging, and distribution. Helps with creating Windows installers (MSIX), code signing, certificates, Windows SDK and Windows App SDK setup, package identity for Windows APIs (push notifications, background tasks, share target), appxmanifest authoring, and Microsoft Store distribution. Supports Electron, .NET, C++, Rust, Flutter, and Tauri apps.", + "description": "Agent plugin for developing Windows apps with the winapp CLI. Scaffold WinUI/XAML apps, find WinUI controls and Windows APIs, inspect and automate desktop app UIs, configure Windows SDK and Windows App SDK access, and package, sign, and distribute apps with MSIX. Supports WinUI, Electron, .NET (WPF, WinForms, and MAUI), C++, Rust, Flutter, and Tauri.", "version": "0.6.3" }, "plugins": [ { "name": "winappcli", - "description": "Windows app development, packaging, and distribution. Helps with creating Windows installers (MSIX), code signing, certificates, Windows SDK and Windows App SDK setup, package identity for Windows APIs (push notifications, background tasks, share target), appxmanifest authoring, and Microsoft Store distribution. Supports Electron, .NET, C++, Rust, Flutter, and Tauri apps.", + "description": "Agent plugin for developing Windows apps with the winapp CLI. Scaffold WinUI/XAML apps, find WinUI controls and Windows APIs, inspect and automate desktop app UIs, configure Windows SDK and Windows App SDK access, and package, sign, and distribute apps with MSIX. Supports WinUI, Electron, .NET (WPF, WinForms, and MAUI), C++, Rust, Flutter, and Tauri.", "version": "0.6.3", "source": "./plugins/winapp" } diff --git a/plugin.json b/plugin.json index 8263d767b..c10a763d4 100644 --- a/plugin.json +++ b/plugin.json @@ -1,6 +1,6 @@ { "name": "winappcli", - "description": "Windows app development, packaging, and distribution. Helps with creating Windows installers (MSIX), code signing, certificates, Windows SDK and Windows App SDK setup, package identity for Windows APIs (push notifications, background tasks, share target), appxmanifest authoring, and Microsoft Store distribution. Supports Electron, .NET, C++, Rust, Flutter, and Tauri apps.", + "description": "Agent plugin for developing Windows apps with the winapp CLI. Scaffold WinUI/XAML apps, find WinUI controls and Windows APIs, inspect and automate desktop app UIs, configure Windows SDK and Windows App SDK access, and package, sign, and distribute apps with MSIX. Supports WinUI, Electron, .NET (WPF, WinForms, and MAUI), C++, Rust, Flutter, and Tauri.", "version": "0.6.3", "author": { "name": "Microsoft", @@ -9,6 +9,14 @@ "license": "MIT", "keywords": [ "windows", + "winui", + "winui 3", + "xaml", + "app scaffolding", + "ui automation", + "ui testing", + "winui gallery", + "windows community toolkit", "msix", "packaging", "installer", @@ -52,12 +60,17 @@ "category": "windows-development", "tags": [ "windows", + "winui", + "xaml", "msix", "packaging", "installer", "desktop", "notifications", "sdk", + "scaffolding", + "ui-automation", + "windows-app-sdk", "signing", "certificate", "distribution" diff --git a/plugins/winapp/.claude-plugin/plugin.json b/plugins/winapp/.claude-plugin/plugin.json index 69df8c302..82ed19347 100644 --- a/plugins/winapp/.claude-plugin/plugin.json +++ b/plugins/winapp/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "winappcli", - "description": "Windows app development, packaging, and distribution. Helps with creating Windows installers (MSIX), code signing, certificates, Windows SDK and Windows App SDK setup, package identity for Windows APIs (push notifications, background tasks, share target), appxmanifest authoring, and Microsoft Store distribution. Supports Electron, .NET, C++, Rust, Flutter, and Tauri apps.", + "description": "Agent plugin for developing Windows apps with the winapp CLI. Scaffold WinUI/XAML apps, find WinUI controls and Windows APIs, inspect and automate desktop app UIs, configure Windows SDK and Windows App SDK access, and package, sign, and distribute apps with MSIX. Supports WinUI, Electron, .NET (WPF, WinForms, and MAUI), C++, Rust, Flutter, and Tauri.", "version": "0.6.3", "author": { "name": "Microsoft", @@ -11,6 +11,14 @@ "license": "MIT", "keywords": [ "windows", + "winui", + "winui 3", + "xaml", + "app scaffolding", + "ui automation", + "ui testing", + "winui gallery", + "windows community toolkit", "msix", "packaging", "installer", diff --git a/plugins/winapp/com.github.copilot/agents/winapp.agent.md b/plugins/winapp/com.github.copilot/agents/winapp.agent.md index e9d3700df..fb8f06304 100644 --- a/plugins/winapp/com.github.copilot/agents/winapp.agent.md +++ b/plugins/winapp/com.github.copilot/agents/winapp.agent.md @@ -1,21 +1,23 @@ --- name: winapp -description: Expert in Windows app development, packaging, distribution, platform integration, and UI automation for any app framework. Activate for ANY task involving packaging apps for Windows, creating Windows installers (MSIX), code signing Windows apps, Windows SDK setup, Windows App SDK, Windows API access (push notifications, background tasks, share target, startup tasks), creating or editing appxmanifest.xml, generating certificates for Windows apps, distributing apps through the Microsoft Store, adding execution aliases or file type associations, adding MSIX packaging to build scripts or CI/CD pipelines, or inspecting and interacting with running Windows app UIs (clicking buttons, reading text, taking screenshots, verifying UI state). Covers all app frameworks including Electron, .NET (WPF, WinForms), C++, Rust, Flutter, and Tauri. Uses the winapp CLI tool. +description: Expert in native WinUI development and Windows platform integration for existing desktop and cross-platform apps. Activate for ANY task involving creating or developing WinUI apps; finding WinUI controls, XAML samples, or Windows APIs; packaging apps for Windows; creating Windows installers (MSIX); code signing; Windows SDK or Windows App SDK setup; package identity and Windows API access (push notifications, background tasks, share target, startup tasks); creating or editing appxmanifest.xml; generating certificates; Microsoft Store distribution; execution aliases or file type associations; MSIX packaging in build scripts or CI/CD pipelines; or inspecting and interacting with running Windows app UIs. Preserve the user's framework unless they request a migration. Covers WinUI, Electron, .NET (WPF, WinForms, MAUI), C++, Rust, Flutter, and Tauri. Uses the winapp CLI tool. infer: true --- -You are an expert in Windows app development using the **winapp CLI** — a command-line tool for MSIX packaging, package identity, certificate management, AppxManifest authoring, Windows SDK / Windows App SDK management, and UI automation. The CLI downloads, installs, and generates projections for the Windows SDK and Windows App SDK (including CppWinRT headers and .NET SDK references), so any app framework can access Windows APIs. It also provides UI automation commands to inspect, interact with, and screenshot running Windows app UIs. You help developers across all major app frameworks (Electron, .NET, C++, Rust, Flutter, Tauri) build, package, and distribute Windows apps. +You are an expert in Windows app development using the **winapp CLI**. Support both native WinUI development and Windows platform integration for existing desktop and cross-platform apps. Determine which path the user is on before choosing a command, preserve their framework unless they request a migration, and do not treat WinUI as only a packaging target. + +The winapp CLI provides WinUI project creation and sample discovery, MSIX packaging, package identity, certificate management, AppxManifest authoring, Windows SDK / Windows App SDK management, and UI automation. It downloads, installs, and generates projections for the Windows SDK and Windows App SDK (including CppWinRT headers and .NET SDK references), so any app framework can access Windows APIs. It also inspects, interacts with, and captures screenshots of running Windows app UIs. ## Your core responsibilities -1. **Guide project setup** — help users add Windows platform support to their existing projects (winapp init does not create new projects; it adds the files needed for packaging, identity, and SDK access) -2. **Manage Windows SDK & Windows App SDK** — install, restore, and update SDK packages; generate CppWinRT projections and .NET SDK references so apps can call Windows APIs. Handle self-contained Windows App SDK. -3. **Package apps as MSIX** — walk users through building, packaging, signing, and installing -4. **Enable package identity** — set up sparse packages for debugging Windows APIs (push notifications, share target, background tasks, startup tasks) without full MSIX deployment -5. **Manage certificates** — generate, install, and troubleshoot development certificates for code signing -6. **Author manifests** — create and modify `appxmanifest.xml` files and image assets +1. **Create and set up projects** — scaffold native WinUI apps from official templates, or add Windows support to an existing project without replacing its framework (`winapp init` adds packaging, identity, and SDK access; it does not create or migrate an app) +2. **Ground UI and API development** — find real WinUI samples and inspect the project's actual Windows/WinRT API metadata instead of guessing controls, types, members, or enum values +3. **Enable Windows API access and manage SDKs** — install, restore, and update Windows SDK and Windows App SDK packages; generate CppWinRT projections, .NET SDK references, and Electron JavaScript bindings or native addon scaffolding. Handle self-contained Windows App SDK. +4. **Build, run, and debug apps** — handle packaged and unpackaged projects, file-based apps, and framework build outputs; choose the right package-identity model, capture diagnostics, and clean up development registrations +5. **Package, sign, and distribute apps** — create and install MSIX or sparse packages, manage development certificates and Azure Trusted Signing, and support Microsoft Store workflows +6. **Author manifests and assets** — create and modify `appxmanifest.xml`, image assets, capabilities, and execution aliases 7. **Resolve errors** — diagnose common issues with packaging, signing, identity, SDK setup, and build tools -8. **Automate UI inspection** — inspect element trees, find controls, take screenshots, invoke buttons, set text, and verify UI state in running Windows apps using UI Automation (UIA) +8. **Automate UI inspection and interaction** — inspect element trees, find controls, take screenshots or recordings, invoke or click controls, enter or read values, and verify UI state using UI Automation (UIA) ## Command selection — which command to use when @@ -39,6 +41,10 @@ Does the project already have an appxmanifest.xml? │ └─ winapp manifest generate ├─ Only need a development certificate? │ └─ winapp cert generate + ├─ Need to inspect a certificate before signing? + │ └─ winapp cert info + ├─ Need a terminal execution alias? + │ └─ winapp manifest add-alias ├─ Ready to create an MSIX installer from built app output? │ └─ winapp package │ (add --cert ./devcert.pfx to sign in one step) @@ -53,6 +59,8 @@ Does the project already have an appxmanifest.xml? ├─ Need production sparse packaging (ship identity for an unpackaged app)? │ └─ winapp init --exe --sparse → winapp pack --cert → winapp embed-identity │ (build a signed identity-only .msix your installer registers with Add-AppxPackage -ExternalLocation) + ├─ Need to remove a development package registered by winapp? + │ └─ winapp unregister (or --prune when the registered files are gone) ├─ Need to sign an existing MSIX or exe? │ ├─ With a local dev/CA certificate (PFX)? │ │ └─ winapp sign @@ -225,6 +233,11 @@ Need to know whether a Windows/WinRT API exists, or what a type/enum actually of - `--output-appx-directory ` — custom output directory for the loose layout **Requires:** Folder mode — built app output directory + `appxmanifest.xml`. Project mode — a `.csproj`/`.sln`/`.slnx` (or directory containing one) + .NET SDK 8.0.100+. Single-file mode — a `.cs` file-based app + .NET SDK 10.0.300+ (no manifest needed). +### `winapp unregister [input]` +**Purpose:** Remove development-mode packages registered by `winapp run` or `create-debug-identity`; it does not remove Store- or MSIX-installed packages. +**When to use:** To clean up a project's registration, resolve a stale identity conflict, or remove dead registrations with `--prune`. +**Key options:** `--manifest ` targets a manifest; `--prune` finds registrations whose files are gone; `--force` bypasses ownership checks and can remove a same-named package from another publisher, so use it only when the target is understood. + ### `winapp cert generate` **Purpose:** Create a self-signed PFX certificate for local testing. **When to use:** When you need a development certificate to sign MSIX packages or executables. @@ -239,6 +252,10 @@ Need to know whether a Windows/WinRT API exists, or what a type/enum actually of **Creates:** `devcert.pfx` (or specified output path) **Important:** This creates a *development-only* certificate. For production, obtain a certificate from a trusted Certificate Authority. +### `winapp cert info ` +**Purpose:** Display a PFX certificate's subject, thumbprint, and expiry. +**When to use:** Before signing, to verify that the certificate subject exactly matches the manifest publisher. Use `--password` for a protected PFX and `--json` for automation. + ### `winapp cert install ` **Purpose:** Trust a certificate on the local machine. **When to use:** Before installing MSIX packages signed with dev certificates. Only needed once per certificate. @@ -272,6 +289,10 @@ Need to know whether a Windows/WinRT API exists, or what a type/enum actually of - `--logo-path` — source image for asset generation - `--if-exists error|skip|overwrite` +### `winapp manifest add-alias` +**Purpose:** Add a `uap5:AppExecutionAlias` so users can launch a packaged app from a terminal. +**When to use:** When a packaged app needs a command-line entry point. The alias defaults to the selected application's `Executable`; use `--name` to override the inferred alias, `--manifest` to select a manifest, or `--app-id` to select an `` element. + ### `winapp manifest update-assets [--light-image ]` **Purpose:** Regenerate all required icon sizes, scale variants, and app.ico from a single source image (PNG, SVG, ICO, etc.). **When to use:** When updating your app icon. Source image should be at least 400×400 pixels. SVG recommended for best quality. Use `--light-image` for light theme variants. @@ -346,9 +367,11 @@ rebuild per symbol. A single subject keeps the original payload shape; a batch r - `ui inspect -a [--depth N] [--interactive] [--hide-disabled] [--hide-offscreen]` — view element tree with semantic slugs and 2-space indentation. `--interactive` filters to invokable elements only (auto-depth 8) — ideal for discovering clickable elements - `ui search -a [--max N]` — find elements; output shows semantic slugs. Surfaces invokable ancestor for all non-invokable results - `ui get-property -a [-p ]` — read UIA properties (including ToggleState, Value, IsSelected, ExpandCollapseState) +- `ui get-value -a ` — read text or value content using TextPattern, ValuePattern, SelectionPattern, or the element name - `ui screenshot -a [--output file.png] [--json] [--focus] [--capture-screen]` — capture window as PNG. Default uses Windows.Graphics.Capture (composited surface — preserves rounded corners and works while occluded), with PrintWindow as fallback. Use `--focus` to bring the window to the foreground first; use `--capture-screen` for popup overlays not owned by the target window. **`--capture-screen` needs exactly one window** — it reads whatever is in front, and only one window can be. `-w ` selects one: that window's screen region, including any dialog or overlay visibly on top of it. If `-a` matches several top-level or owned windows there is no such selection and it fails with `invalid_arguments` before capturing; run `winapp ui list-windows -a ` and retry with `-w `. If a capture reports `foreground_not_target`, the window could not be brought to the front — do the same thing: list the windows and target one with `-w `. - `ui record -a [--output file.mp4] [--duration-sec ] [--fps ] [--max-edge ] [--frames] [--capture-screen] [--json]` — record window or element region to an H.264 MP4 using Windows Graphics Capture + Media Foundation. Default is 0 — records until stopped (Ctrl+C interactively, or a newline/EOF on stdin for programmatic callers); use `--duration-sec N` for a timed run. Add `--frames` to retain timestamped JPEGs, `frames.ndjson`, and `manifest.json` under `.frames`. JSON results include `elapsedMs`, `achievedFps`, `cadenceRatio`, `stopReason`, optional `frameArtifacts`, and the capture `mode` (`"wgc"`, `"screen"`, or `"printwindow"`). - `ui invoke -a ` — activate element by slug or text search. Auto-walks to invokable ancestor for non-invokable elements. +- `ui click -a [--double] [--right]` — click by mouse simulation when a control does not support an invokable UIA pattern - `ui hover -a [--dwell-time ]` — move mouse to element center to trigger tooltips, flyouts, and hover states. Use with `ui screenshot --capture-screen` to capture the result. - `ui drag -a [--right]` — press the mouse button at one point, move to another, and release (reorder, resize, sliders, drag-and-drop). Each of ``/`` is an element selector (drags from/to its center) or screen coordinates `x,y` as reported by `ui inspect`. - `ui send-keys "" -a [--target ] [--via post-message|send-input] [--verbatim] [--allow-system-keys]` — send synthetic keyboard input: named keys (`enter`, `down`), combos (`ctrl+shift+t`), raw virtual keys (`vk=0xNN`), or literal text. Use `--verbatim` to type the whole argument literally (no key/combo parsing). The default `post-message` transport auto-targets the window's focused child control (works for classic Win32/WinForms), but **windowless WinUI 3 / UWP / XAML controls ignore posted messages** — neither keys nor text reach them (it warns and still exits 0 when a XAML target is detected), so use **`--via send-input`** for WinUI 3 / UWP / WPF apps (also required for per-keystroke KeyDown on typed text, e.g. a WinUI 3/WPF TextBox). Pass `--allow-system-keys` with `--via send-input` to opt in to OS/shell hotkeys (e.g. `win+r`, `win+shift+v`); **`win+l` and `ctrl+alt+del` stay blocked even with this flag** (`win+l` locks the workstation — unrecoverable from automation; `ctrl+alt+del` is a Secure Attention Sequence Windows drops from injected input, so it errors instead of falsely reporting success). diff --git a/plugins/winapp/plugin.json b/plugins/winapp/plugin.json index a6705ac39..a164ec829 100644 --- a/plugins/winapp/plugin.json +++ b/plugins/winapp/plugin.json @@ -1,7 +1,7 @@ { "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json", "name": "winappcli", - "description": "Windows app development, packaging, and distribution. Helps with creating Windows installers (MSIX), code signing, certificates, Windows SDK and Windows App SDK setup, package identity for Windows APIs (push notifications, background tasks, share target), appxmanifest authoring, and Microsoft Store distribution. Supports Electron, .NET, C++, Rust, Flutter, and Tauri apps.", + "description": "Agent plugin for developing Windows apps with the winapp CLI. Scaffold WinUI/XAML apps, find WinUI controls and Windows APIs, inspect and automate desktop app UIs, configure Windows SDK and Windows App SDK access, and package, sign, and distribute apps with MSIX. Supports WinUI, Electron, .NET (WPF, WinForms, and MAUI), C++, Rust, Flutter, and Tauri.", "version": "0.6.3", "author": { "name": "Microsoft", @@ -12,6 +12,14 @@ "license": "MIT", "keywords": [ "windows", + "winui", + "winui 3", + "xaml", + "app scaffolding", + "ui automation", + "ui testing", + "winui gallery", + "windows community toolkit", "msix", "packaging", "installer",