winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

Add short command aliases to improve user experience and efficiency

Open m3h3d1ha2an opened this issue 1 year ago • 5 comments

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:

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

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.

m3h3d1ha2an avatar Aug 30 '24 02:08 m3h3d1ha2an

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.

github-actions[bot] avatar Aug 30 '24 02:08 github-actions[bot]

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

Some of these are already taken:

  • -a,--architecture - Select the architecture
  • -e,--exact - Find package using exact match
  • -h,--silent - Request silent installation
  • -i,--interactive - Request interactive installation; user input may be needed
  • -l,--location - Location to install to (if supported)
  • -o,--log - Log location (if supported)
  • -r,--rename - The value to rename the executable file (portable)
  • -s,--source - Find package using the specified source
  • -v,--version - Use the specified version; default is the latest version

stephengillie avatar Aug 30 '24 15:08 stephengillie

uninstall -> rm

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

mdanish-kh avatar Aug 30 '24 15:08 mdanish-kh

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.

denelon avatar Aug 30 '24 18:08 denelon

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

  • install => add
  • list => ls
  • uninstall => rm

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

Trenly avatar Sep 19 '24 21:09 Trenly