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.09k stars 1.44k forks source link

Search after install finds no match #581

Open Suirtimed opened 4 years ago

Suirtimed commented 4 years ago

Perform a search if an install has no results

If I execute winget install nightingale I get an error message. "No package found matching input criteria"

The correct command would have been winget install "Nightingale REST Client"

If an install doesn't find a match, then the client should perform a search. If only one result matches, the user could be prompted to install the package that was found (if only one is found).

Proposed technical implementation details (optional)

First Example winget install nightingale No package found matching input criteria. Executing winget search nightingale Name Id Version Source

Nightingale REST Client 43891JeniusApps.NightingaleRESTAPIClient Latest  msstore
Would you like to install [Y/N]?

Second Example winget install terminal No package found matching input criteria. Executing winget search terminal Name Id Version Match Source

IO Ninja                 tibbo.ioninja                    3.14.4     Tag: terminal     winget
Windows Terminal         Microsoft.WindowsTerminal        1.3.2651.0 Tag: terminal     winget
Terminus                 Eugeny.Terminus                  1.0.120    Tag: terminal     winget
Alacritty                Alacritty.Alacritty              0.4.3      Tag: terminal     winget
bottom                   Clement.bottom                   0.4.7      Tag: terminal     winget
Windows Terminal Preview Microsoft.WindowsTerminalPreview 1.4.2652.0 Moniker: Terminal winget
SecureDNS.Terminal       Texnomic.SecureDNS.Terminal      0.3-alpha                    winget
Fluent Terminal          53621FSApps.FluentTerminal       Latest                       msstore
TerminAll                BEDKOAS.TerminAll                Latest                       msstore
Windows Terminal         Microsoft.WindowsTerminal        Latest                       msstore
Windows Terminal Preview Microsoft.WindowsTerminalPreview Latest                       msstore
>
Chaphasilor commented 3 years ago

In addition (or as an alternative), some kind of typo-toleration would be nice!

Running winget install python3 doesn't find any package (because Python 3's package name is just python, there is no Python 2 like on other package managers).
Given that python3 is only a single character away from python, it would be extremely helpful if winget could at least output something along the lines of No package found matching input criteria.\nDid you mean python (Python.Python@3.9.2)?
It could even prompt to install the app right-away, like suggested by @Suirtimed.

I feel like just running winget install python right-away and hoping for it to be the right version isn't a good alternative (because there's no confirmation prompt before installation), so typo-tolerance/suggestions about the closest matching packet would be very helpful!