winapp: Microsoft's CLI tool for cross-platform Windows development
With the CLI tool winapp, Microsoft wants to simplify Windows development for cross-platform developers. It handles SDK management and packaging.
(Image: Microsoft)
Microsoft has introduced a new command-line tool for Windows app development. winapp CLI is intended to simplify the development process for applications created with frameworks such as Electron or languages such as Rust, C++, and .NET. It combines cross-platform development with the native Windows environment. The open-source tool is currently in public preview and is freely available on GitHub.
The central promise: what previously required twelve manual steps should now be accomplished with a single command. The command winapp init automatically downloads the necessary SDKs, such as Windows SDK and Windows App SDK, generates code projections, such as C++/WinRT, and configures manifests, assets, certificates, and dependencies. The tool is deliberately designed so that developers can continue to use their familiar editors, whether VS Code or other IDEs. With winapp restore, the exact development environment can be restored for shared projects or in CI/CD pipelines.
Package Identity without Full Packaging
The create-debug-identity function is particularly interesting for cross-platform developers. It temporarily adds a package identity to an executable file without the application having to be fully packaged as an MSIX package. This significantly speeds up the development cycle, as modern Windows APIs such as Windows AI APIs, notifications, shell integration, or background tasks use such an identity.
Videos by heise
For Electron developers, Microsoft offers a special npm package: with npm install @microsoft/winappcli --save-dev, winapp can be integrated into existing projects. The command winapp node add-electron-debug-identity injects the package identity directly into the running process. Additionally, the @microsoft/winapp-windows-ai package provides Node.js projections for Microsoft's AI APIs, for example, for local language models or text and image processing.
MSIX Packaging and CI/CD Integration
The tool also handles the creation of MSIX packages for distribution via the Microsoft Store or sideloading. With winapp pack ./my-app-files --cert ./devcert.pfx, it generates store-ready or manually deployable packages. Developer certificates can be created via winapp cert generate and optionally installed locally. Updating manifest resources also works via the CLI, for example with winapp manifest update-assets C:\images\my-logo.png.
For continuous integration workflows, Microsoft offers Actions for GitHub Actions and Azure DevOps. The setup-WinAppCli-Action automatically installs winapp in the pipeline. Developers can use it to create consistent build environments without having to manually configure SDKs or tools.
Alternatives to Visual Studio and MSBuild
According to the announcement, winapp CLI is explicitly intended as a supplement for developers working outside the Visual Studio ecosystem. In addition to Electron and Rust, winapp also supports C++ with CMake, .NET, Dart, and other languages and frameworks. Guides for these technologies, as well as example projects, can be found in the GitHub repository.
Installation can be done via WinGet with winget install Microsoft.winappcli --source winget, as an npm package, or manually via GitHub Releases. During the public preview, Microsoft is collecting feedback via the GitHub repository. Which features will be prioritized and when a final version will be released is currently open. For developers who rely on alternative cross-platform frameworks, options such as .NET MAUI, Avalonia, Uno Platform, or React Native for Desktop remain available.
(fo)