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

'install git' matches multiple apps, messaging unclear

Open bitcrazed opened this issue 6 years ago • 12 comments

Environment

winget --info
Windows Package Manager v0.1.41301 Preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19041.208
Package: Microsoft.DesktopAppInstaller v1.0.41301.0

Links:
  Privacy Statement: https://aka.ms/winget-privacy
  License agreement: https://aka.ms/winget-license
  3rd Party Notices: https://aka.ms/winget-3rdPartyNotice
  Homepage:          https://aka.ms/winget

Steps to reproduce

Attempt to install git with winget:

winget install git

Expected behavior

Git installs without further prompting.

Actual

Git fails to install. Unclear for the user what to do next.

Multiple apps found matching input criteria. Please refine the input.
Name                    Id                                Version      Matched
-----------------------------------------------------------------------------------
Git                     Git.Git                           2.26.2       Moniker: git
Atom                    GitHub.Atom                       1.45.0
GitKraken               Axosoft.GitKraken                 6.5.4
Logitech Harmony Remote Logitech.Harmony                  1.0.1.308
GitHub Desktop          GitHub.GitHubDesktop              2.4.3
AppInstallerFileBuilder Microsoft.AppInstallerFileBuilder 1.2020.211.0 Tag: GitHub

🏆 For a bonus: Why are "Atom" and "Logitech Harmony Remote" packages returned in the list when installing git?

bitcrazed avatar May 12 '20 23:05 bitcrazed

@bitcrazed I've tagged this as a Task for someone to improve the message. The user in this case would need to specify by "Id" so the command would be "winget install git.git". Would it make more sense to you to have the client provide an example?

Multiple apps found matching input criteria. Please refine the input. Example: winget install Git.Git

Your bonus🏆 Search is doing a fuzzy search across multiple fields. Atom - Id: GitHub.Atom Logitech Harmony Remote - Name: Logitech Harmony Remote

denelon avatar May 12 '20 23:05 denelon

Providing actionable error messages, esp. with command-line tools is HIGHLY recommended, but then, if the tool can determine that the user likely actually wanted to install git and therefore they should type git.git ... why not just install git like they asked?

While I appreciate (and like) the fuzzy search when searching apps, I'd argue that name resolution when installing apps should be MUCH more precise, and should perhaps match on moniker, then name, then ID, in that order

bitcrazed avatar May 13 '20 00:05 bitcrazed

Yeah, please make the install search far more precise. I tried installing .NET Core soon after the news dropped. winget install dotnet matches both .NET Core and .NET Framework. Searching by ID (winget install --id microsoft.dotnet) gave me the same result. Took me two more minutes figuring out the intended way of installing it via the moniker.

Dormanil avatar May 19 '20 17:05 Dormanil

I think it would help if the matched text is highlighted with an alternate color when dealing with ambiguous/multiple results.

ocitrev avatar May 20 '20 04:05 ocitrev

I mean, I am not blind. I see why both are results. I just want the install side of things to expect wholly unambiguous queries, instead of winget forcing the developer to find the one value that disambiguates it and then repeat their query with the right switch flipped. Highlighting would be totally fine when searching for available packages.

Dormanil avatar May 20 '20 05:05 Dormanil

D:\ndr\src > winget install --id git.git
Multiple apps found matching input criteria. Please refine the input.
Name   Id         Version
-------------------------
Git    Git.Git    2.26.2
GitLFS Git.GitLFS 2.11.0
PS amd64fre D:\ndr\src user/jonwis/build-fix-apt7exp 5/25/2020 1:57 PM
D:\ndr\src > winget install --exact --id git.git
No app found matching input criteria.
PS amd64fre D:\ndr\src user/jonwis/build-fix-apt7exp 5/25/2020 2:01 PM

Note the casing requirement and the --exact.

jonwis avatar May 25 '20 21:05 jonwis

From using Linux with larger package repositories and community repos. I can say fuzzy search is a required inconvenience.

NicTanghe avatar May 31 '20 14:05 NicTanghe

At the moment, when installing apps with multiple search results, the following nomenclature is working perfectly:

winget install --name <appName> -e

Note that the appName is Case Sensitive !

SubhamK108 avatar Jun 03 '20 12:06 SubhamK108

D:\ndr\src > winget install --id git.git
Multiple apps found matching input criteria. Please refine the input.
Name   Id         Version
-------------------------
Git    Git.Git    2.26.2
GitLFS Git.GitLFS 2.11.0
PS amd64fre D:\ndr\src user/jonwis/build-fix-apt7exp 5/25/2020 1:57 PM
D:\ndr\src > winget install --exact --id git.git
No app found matching input criteria.
PS amd64fre D:\ndr\src user/jonwis/build-fix-apt7exp 5/25/2020 2:01 PM

Note the casing requirement and the --exact.

I had the same issue as well. Found the above fix of using the --name -e worked. It looks like it could be a case sensitive issue.

leepryor avatar Jun 08 '20 02:06 leepryor

At the moment, when installing apps with multiple search results, the following nomenclature is working perfectly:

winget install --name <appName> -e

Note that the appName is Case Sensitive !

It works. And then a graphical installer appears. I just expected as silently installing as Ubuntu did.

maisonhai3 avatar Jun 11 '20 09:06 maisonhai3

I agree. This is too complicated. I don't want to study winget to be able to use winget. And I found this issue because I couldn't get winget to instal git.git even after looking at the docs for 5 minutes.

Fuzzy search is great -- when I do a winget search or my winget install doesn't exist, like for "git".

But when I want to install something, I want simple commands. winget install should accept the exact id by default. So winget install git.git installs that package and winget install git should give you an error that a package with that name does not exist, but also do a fuzzy search for git to suggest what you probably meant.

At the very least winget install --id should expect an exact match and not ask me whether I want to install git.git or git.gitlfs when I specifically wrote winget install --id git.git.

Ps. oh, and case sensitive app names just asks for trouble. Hypothetically, what would be the difference between "Git.Git" and "git.git"? The former is the official package, the latter could be malware. It's even worse than NPM...

danielniccoli avatar Jun 27 '20 15:06 danielniccoli

This was fixed in https://github.com/microsoft/winget-cli/releases/tag/v0.1.42101-preview.

denelon avatar Aug 21 '20 15:08 denelon