{"id":1328,"date":"2026-07-22T10:29:10","date_gmt":"2026-07-22T17:29:10","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/?p=1328"},"modified":"2026-07-22T10:29:43","modified_gmt":"2026-07-22T17:29:43","slug":"windows-app-development-cli-v0-5-0-expanded-ui-automation-js-ts-bindings-and-more","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/windows-app-development-cli-v0-5-0-expanded-ui-automation-js-ts-bindings-and-more\/","title":{"rendered":"Windows App Development CLI v0.5.0 &#8211; expanded UI automation, JS\/TS bindings, and more"},"content":{"rendered":"<p><a href=\"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/07\/blog-hero-rounded.webp\"><img decoding=\"async\" class=\" wp-image-1331 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/07\/blog-hero-rounded-300x167.webp\" alt=\"blog hero rounded image\" width=\"696\" height=\"387\" srcset=\"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/07\/blog-hero-rounded-300x167.webp 300w, https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/07\/blog-hero-rounded-1024x570.webp 1024w, https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/07\/blog-hero-rounded-768x427.webp 768w, https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/07\/blog-hero-rounded.webp 1231w\" sizes=\"(max-width: 696px) 100vw, 696px\" \/><\/a><\/p>\n<p>WinApp CLI v0.5.0 greatly expands the UI automation toolkit (recording, touch, pen, and keyboard injection), lets you call Windows Runtime APIs straight from JavaScript and TypeScript with zero native addons, and makes WinUI crashes far easier to diagnose. Get the update by running <code class=\"language-default\">winget install Microsoft.WinAppCLI<\/code> or <a href=\"https:\/\/github.com\/microsoft\/winappCli\">check the repo for other install options<\/a>.<\/p>\n<p><div  class=\"d-flex justify-content-left\"><a class=\"cta_button_link btn-primary mb-24\" href=\"https:\/\/github.com\/microsoft\/winappCli\" target=\"_blank\">Get started with the Windows App Development CLI<\/a><\/div><\/p>\n<p>Here&#8217;s what the new version has to offer in depth:<\/p>\n<h2>\ud83d\udd79\ufe0f An expanded UI automation toolkit<\/h2>\n<div>\n<p>The <code class=\"language-default\">winapp ui<\/code> command family grew from inspection into a complete automation toolkit. On top of the existing inspect\/click\/screenshot verbs, these releases add real input injection, including touch, pen, and keyboard. Additionally, we added screen recording, so that you (or an AI agent) can drive and verify any Windows app end-to-end from the terminal.<\/p>\n<\/div>\n<div>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\"># Record a session to MP4 (great for demos and bug reports)\r\nwinapp ui record -a myapp --duration-sec 10 --output demo.mp4\r\n\r\n# Synthesize real touch gestures\r\nwinapp ui touch img-map-9f8e -a myapp --gesture pinch --distance 200\r\nwinapp ui touch -a myapp --at 100,300 --gesture swipe --to-point 400,300\r\n\r\n# Draw and erase with a simulated pen\/stylus\r\nwinapp ui pen -a myapp --path \"100,100 150,120 210,140 260,120\"\r\nwinapp ui pen -a myapp --at 320,240 --pressure 0.8 --tilt-x 30\r\n\r\n# Send real keystrokes, including chords and typed text\r\nwinapp ui send-keys \"ctrl+a delete\" -a myapp\r\nwinapp ui send-keys \"Hello world\" --target txt-name-a1b2 -a myapp<\/code><\/pre>\n<\/div>\n<div>\n<p>Rounding out the set: <code class=\"language-default\">ui hover<\/code> captures tooltips and flyouts, <code class=\"language-default\">ui drag<\/code> performs press-move-release drags (element-to-element or raw coordinates), and <code class=\"language-default\">ui scroll --wheel<\/code> drives mouse-wheel scrolling:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\"># Hover to reveal a tooltip, then screenshot it\r\nwinapp ui hover btn-info-a1b2 -a myapp\r\nwinapp ui screenshot -a myapp --capture-screen\r\n\r\n# Drag one element onto another (or use raw screen coords)\r\nwinapp ui drag itm-card-9f8e itm-slot-2c1a -a myapp\r\nwinapp ui drag 120,200 480,200 -a myapp\r\n\r\n# Mouse-wheel scroll over an element\r\nwinapp ui scroll img-map-a1b2 --wheel -1 -a myapp<\/code><\/pre>\n<p>These new automation actions enable agents to interact fully with a running application. The following MS Paint demo was fully automated using <code>ui<\/code> commands (including <code>invoke<\/code> and <code>drag<\/code>), and was recorded using <code>ui record<\/code>:<\/p>\n<\/div>\n<p><div style=\"width: 2040px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-1328-1\" width=\"2040\" height=\"1162\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/07\/windows-logo-drawing-1.mp4?_=1\" \/><a href=\"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/07\/windows-logo-drawing-1.mp4\">https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/07\/windows-logo-drawing-1.mp4<\/a><\/video><\/div><\/p>\n<h2>\ud83d\udfe8 Call Windows APIs Directly from JavaScript &amp; TypeScript<\/h2>\n<div>\n<p>Electron and Node developers can now call modern Windows Runtime (WinRT) APIs, including notifications, file pickers, Windows AI, WinML, and more, directly from JavaScript or TypeScript. <strong>No native addon, no node-gyp or MSBuild step, and full IntelliSense.<\/strong><\/p>\n<\/div>\n<div>\n<p>Add typed bindings to a new or existing project with a single flag:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">npx winapp init . --use-defaults --add-js-bindings<\/code><\/pre>\n<p>WinApp CLI generates typed <em>.js<\/em> + <em>.d.ts<\/em> bindings from the WinAppSDK (and any other WinRT) <em>.winmd<\/em> metadata, and those bindings call into WinRT at runtime via <code class=\"language-default\">@microsoft\/dynwinrt<\/code>. Import them through the <code class=\"language-default\">#winapp\/bindings<\/code> subpath and call WinRT like ordinary JavaScript:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">const {\r\n  AppNotificationBuilder,\r\n  AppNotificationManager,\r\n} = require('#winapp\/bindings');\r\n\r\nconst notification = AppNotificationBuilder\r\n  .create()\r\n  .addText('Hello from WinRT \u2014 no native addon required')\r\n  .build();\r\n\r\nAppNotificationManager.getDefault().show(notification);<\/code><\/pre>\n<p>The generated bindings stay version-synced with your WinAppSDK packages, so IntelliSense always matches the APIs you actually have.<\/p>\n<\/div>\n<p>We&#8217;ll be releasing a full blog post on using these bindings soon, so stay tuned for that. In the meantime, you can check out our <a href=\"https:\/\/github.com\/microsoft\/winappCli\/blob\/main\/docs\/guides\/electron\/js-file-picker.md\">guide on calling Windows APIs from JavaScript.<\/a><\/p>\n<h2>\ud83e\ude7a Better WinUI Crash Diagnostics<\/h2>\n<div>\n<p>Debugging WinUI 3 crashes has always been painful: most start inside a XAML event handler and surface later as a <strong>stowed exception<\/strong> (<code class=\"language-default\">0xC000027B<\/code>) re-raised from the dispatcher, so by the time the app dies the stack no longer points at the real cause.<\/p>\n<\/div>\n<div>\n<p>Now <code class=\"language-default\">winapp run --debug-output<\/code> automatically runs an extra <strong>WinUI stowed-exception triage pass<\/strong> whenever the crashed app loaded <em>Microsoft.UI.Xaml.dll<\/em>. No new flag is required; it will kick in for any WinUI dumps and surfaces:<\/p>\n<ul>\n<li>The originating HRESULT and its full <strong>ErrorContext<\/strong> chain<\/li>\n<li>The native XAML dispatch stack (<code class=\"language-default\">Microsoft.UI.Xaml<\/code> \u2192 <code class=\"language-default\">CXcpDispatcher<\/code> \u2192 <code class=\"language-default\">CoreMessagingXP<\/code> \u2192 CLR host)<\/li>\n<li>The managed user frame that actually threw, from the existing ClrMD analysis<\/li>\n<\/ul>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\"># Auto-triage on crash; add --symbols for fully-resolved names\r\nwinapp run .\\build\\Debug --debug-output --symbols<\/code><\/pre>\n<p>Under the hood, winapp hosts DbgEng and runs the WinUI team&#8217;s triage extension against the same minidump, so no WinDbg install is required. All debugger binaries are version-pinned, hash-verified, and signature-checked before use, and everything is cached for offline runs. The standard managed\/native analysis is unchanged for every other app. Here&#8217;s an example of the new crash output:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/07\/Screenshot-2026-07-21-182228.webp\"><img decoding=\"async\" class=\"wp-image-1339 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/07\/Screenshot-2026-07-21-182228-300x160.webp\" alt=\"Screenshot 2026 07 21 182228 image\" width=\"717\" height=\"382\" srcset=\"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/07\/Screenshot-2026-07-21-182228-300x160.webp 300w, https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/07\/Screenshot-2026-07-21-182228-1024x547.webp 1024w, https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/07\/Screenshot-2026-07-21-182228-1536x821.webp 1536w, https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-content\/uploads\/sites\/61\/2026\/07\/Screenshot-2026-07-21-182228.webp 1734w\" sizes=\"(max-width: 717px) 100vw, 717px\" \/><\/a><\/p>\n<\/div>\n<h2>\u26a1 Other Notable Changes<\/h2>\n<ul>\n<li><strong>Native PowerShell winget cmdlet<\/strong>: The README now documents installing via the native PowerShell <code class=\"language-default\">winget<\/code> cmdlet alongside the classic CLI.<\/li>\n<li><strong><code class=\"language-default\">screenshot<\/code> auto-creates output directories<\/strong>: Point <code class=\"language-default\">ui screenshot<\/code> at a path that doesn&#8217;t exist yet and winapp creates it instead of erroring out.<\/li>\n<li><strong>Claude Code plugin<\/strong>: Added a Claude Code plugin, kept automatically in sync with the GitHub Copilot CLI plugin.<\/li>\n<li><strong>WinApp VS Code extension<\/strong>: Added AppxManifest editor support; the extension now lives in its own <a href=\"https:\/\/github.com\/microsoft\/WinAppVSCE\">microsoft\/WinAppVSCE<\/a> repository and is available on the Visual Studio Marketplace. Read more about the new manifest editor in the <a href=\"https:\/\/devblogs.microsoft.com\/ifdef-windows\/announcing-a-new-visual-manifest-editor-in-the-winapp-vs-code-extension\/\">latest WinApp VSCE blog post<\/a>.<\/li>\n<\/ul>\n<h2>\ud83d\udc1b Bug Fixes<\/h2>\n<ul>\n<li>Fixed a certificate bug with multi-component publisher validation<\/li>\n<li>Fixed <code class=\"language-default\">ui send-keys --via send-input<\/code> silently dropping characters on long text<\/li>\n<li>Fixed <code class=\"language-default\">ui send-keys --via post-message<\/code> silently dropping input<\/li>\n<li>Fixed a dropped <code class=\"language-default\">\\n<\/code> escape in <code class=\"language-default\">send-keys text=<\/code><\/li>\n<li><code class=\"language-default\">ui touch<\/code>\/<code class=\"language-default\">ui pen<\/code> now warn (instead of rejecting) on out-of-window coordinates<\/li>\n<li>Fixed <code class=\"language-default\">ui set-value<\/code> on RichEditBox \/ TextPattern-only edit controls via a LegacyIAccessible fallback<\/li>\n<li>Fixed <code class=\"language-default\">@<\/code>-prefixed arguments being swallowed by response-file expansion<\/li>\n<li>Fixed a silent failure in <code class=\"language-default\">--debug-output<\/code> and added a warning when <code class=\"language-default\">--symbols<\/code> is passed on its own<\/li>\n<\/ul>\n<h2>\u26d3\ufe0f\u200d\ud83d\udca5 Breaking Changes<\/h2>\n<ul>\n<li><strong>UI coordinate terminology standardized<\/strong> (v0.5.0): &#8220;app&#8221; coordinates are now called &#8220;screen&#8221; coordinates across the <code class=\"language-default\">ui<\/code> commands. If your scripts reference the old terminology, update them to match. See the <a href=\"https:\/\/github.com\/microsoft\/winappCli\/releases\/tag\/v0.5.0\">0.5.0 release notes<\/a>.<\/li>\n<\/ul>\n<h2>\ud83d\udda5\ufe0f Get started today<\/h2>\n<p>The Windows App Development CLI is available now in public preview. Visit our <a href=\"https:\/\/github.com\/microsoft\/WinAppCli\">GitHub repository<\/a> for documentation, guides, and to file issues. We would love to hear your feedback!<\/p>\n<p><strong>Install via WinGet:<\/strong><\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">winget install microsoft.winappcli<\/code><\/pre>\n<p><strong>Install via npm:<\/strong><\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">npm install --save-dev @microsoft\/winappcli<\/code><\/pre>\n<p>Happy coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WinApp CLI v0.5.0 greatly expands the UI automation toolkit (recording, touch, pen, and keyboard injection), lets you call Windows Runtime APIs straight from JavaScript and TypeScript with zero native addons, and makes WinUI crashes far easier to diagnose. Get the update by running winget install Microsoft.WinAppCLI or check the repo for other install options. Here&#8217;s [&hellip;]<\/p>\n","protected":false},"author":73101,"featured_media":1331,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1328","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ifdef-windows"],"acf":[],"blog_post_summary":"<p>WinApp CLI v0.5.0 greatly expands the UI automation toolkit (recording, touch, pen, and keyboard injection), lets you call Windows Runtime APIs straight from JavaScript and TypeScript with zero native addons, and makes WinUI crashes far easier to diagnose. Get the update by running winget install Microsoft.WinAppCLI or check the repo for other install options. Here&#8217;s [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-json\/wp\/v2\/posts\/1328","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-json\/wp\/v2\/users\/73101"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-json\/wp\/v2\/comments?post=1328"}],"version-history":[{"count":1,"href":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-json\/wp\/v2\/posts\/1328\/revisions"}],"predecessor-version":[{"id":1350,"href":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-json\/wp\/v2\/posts\/1328\/revisions\/1350"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-json\/wp\/v2\/media\/1331"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-json\/wp\/v2\/media?parent=1328"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-json\/wp\/v2\/categories?post=1328"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/ifdef-windows\/wp-json\/wp\/v2\/tags?post=1328"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}