-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Enable Command Chaining for "winget show" and "winget install" #5046
Comments
@davidldennison - you can already install multiple packages in a single install command similar to how you described |
@Trenly Oh sweet! I didn't know that as it's not in the documentation:
Is there somewhere else I can find docs about this capability? Thanks in advance! |
I don’t know that there is any formal documentation, but here are the main items found just by searching for
|
FWIW, that functionality is available for |
WHATTTTTTT 🤯 @florelis that is such a golden nugget about the ellipsis!! Appreciate it! 🚀 |
Description of the new feature / enhancement
Description:
I’d like to propose an enhancement to the Winget-CLI to support command chaining, particularly for winget show and winget install. I'm not exactly sure about the technical limitations of such a feature, but it's something I wished was a feature for quite a while now!
Currently, if you want to query or install multiple packages, you need to run separate commands for each package, which can quickly become tedious—especially when exploring for new tools, checking download locations, or checking versions for example. By enabling chaining, Winget could take a significant step toward improving the user experience for both new and experienced users, aligning more in terms of functionality set by package managers like Homebrew and apt-get.
This feature would allow users to execute commands like the following:
winget show GitHub.cli GitHub.GitHubDesktop GitTools.GitVersion StefHeyenrath.GitHubReleaseNotes
This would display information about all specified packages in one output, saving users from having to run separate commands for each package.
Similarly, chaining could also extend to winget install:
winget install GitHub.cli GitHub.GitHubDesktop GitTools.GitVersion StefHeyenrath.GitHubReleaseNotes
This would install multiple applications in a single command.
Benefits of Adding winget show Chaining
Improved Package Discovery:
Many package names may not be self-explanatory. For instance, a user might not know whether
GitTools.GitVersion
is related to git, GitHub, or both. By chaining winget show, users can query multiple packages in a single command to better understand what they are installing.Streamlined User Experience:
Reduces the need for repetitive commands when researching packages or confirming package details before installation.
Combines efficiency with clarity, making winget a more effective tool for package management.
Ideal for New and Advanced Users Alike:
New Users: Helps users transitioning to Windows from macOS and Linux package managers understand packages faster.
Advanced Users: Enables faster workflows by combining queries into a single command.
Pre-installation Transparency:
Users can see descriptions, version details, and dependencies for multiple packages at once, reducing errors and improving confidence in installations.
Extending Command Chaining to winget install
While the winget show chaining is the primary focus of this request, adding similar functionality for winget install would also:
- Simplify Onboarding: Users setting up a new machine could install multiple applications with one command, saving time.
- Boost Adoption from macOS and Linux Users: Homebrew and Linux package managers like apt-get allow similar functionality, making Windows more attractive to cross-platform developers.
- Support for Automation: Chaining reduces complexity in batch scripts and automation pipelines, benefiting developers and IT professionals alike.
Why This Matters
With the rise of AI development and the need for cross-platform tools, Microsoft has an opportunity to attract macOS and Linux users to Windows. Features like this improve usability and align with what developers expect from modern package managers, ensuring Windows remains competitive as a development platform.
Proposed technical implementation details
Implementation Suggestion
winget show
to accept multiple package IDs as arguments and display their details in sequential order.winget install
chaining to handle multiple packages in one command, processing them sequentially.Technical Implementation Overview
To implement command chaining for winget show and winget install using the Winget COM API:
Argument Parsing:
Extend the Winget CLI to accept multiple package IDs or names as arguments for both commands (e.g., winget show Package1 Package2 or winget install Package1 Package2).
Batch Query and Installation:
For winget show: Invoke the FindPackages API sequentially for each package, or extend the COM API to support batch queries to minimize overhead.
For winget install: Use the InstallPackage method in sequence for multiple packages, ensuring robust error handling to skip failed installations without interrupting the process.
Enhanced Output and Error Handling:
Aggregate and format query results or installation progress for multiple packages into a clear, user-friendly output.
Gracefully handle invalid package names, query failures, or installation errors by logging and continuing with subsequent packages.
API Enhancements:
Introduce new batch methods like FindPackagesBatch or InstallPackagesBatch to allow the COM API to handle multiple packages in a single call, optimizing performance.
Backward Compatibility:
Ensure single-package queries and installations work seamlessly alongside the new multi-package chaining functionality. This approach streamlines workflows, reduces repetitive commands, and aligns Winget with the capabilities of other modern package managers like Homebrew and apt-get.
The text was updated successfully, but these errors were encountered: