microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
23.38k stars 1.46k forks source link

Add short command aliases to improve user experience and efficiency #4775

Open thecodermehedi opened 3 months ago

thecodermehedi commented 3 months ago

Description of the new feature / enhancement

I propose adding short command aliases to winget-cli to enhance user experience and improve efficiency for frequent users. This feature would allow users to execute common winget commands using abbreviated versions of both the main command and its subcommands.

Currently, users need to type out full commands like:

winget install -e --id Git.Git

With the proposed feature, users could instead use shorter aliases like:

wg i -e --id Git.Git

This enhancement would:

  1. Reduce typing effort for frequent users
  2. Improve command memorability
  3. Align winget more closely with other popular CLI tools that offer similar shortcuts
  4. Maintain full backward compatibility with existing long-form commands

Proposed alias examples:

Proposed technical implementation details

  1. Implement an alias mapping system that translates short commands to their full equivalents.
  2. Add a configuration file (e.g., winget-aliases.json) where users can define custom aliases.
  3. Modify the command parser to check for aliases before processing the full command.
  4. Update the help documentation to include information about aliases and how to use them.
  5. Optionally, add a new command like winget alias to manage custom aliases directly from the CLI.

This feature would make winget more user-friendly while maintaining its current functionality and compatibility. It would be particularly beneficial for power users and those who frequently use winget in scripts or daily workflows.

github-actions[bot] commented 3 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

stephengillie commented 3 months ago

winget -> wg install -> i search -> s list -> l upgrade -> u uninstall -> rm

Some of these are already taken:

mdanish-kh commented 3 months ago

uninstall -> rm

This one already exists. winget <command> --help would show you all aliases available, but most of them aren't short like rm

denelon commented 3 months ago

The primary command "winget" isn't something we would likely shorten in the "CLI", but the PowerShell Module can have shorter aliases for cmdlets.

The auto-completion feature can also save typing in the CLI, and PowerShell already has a notion of this.

Trenly commented 2 months ago

There do already exist short aliases for some of these, as @mdanish-kh mentioned. Specifically,

The one character aliases could be very confusing to new users - i could be for import or install; s could be for show, search, source, or settings