-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add interactive selection for ambiguous package matches #6575
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
Merged
AmirMS (AmelBawa-msft)
merged 36 commits into
feature/multi-source-deduplication
from
user/amelbawa/interactive-package-selection
Oct 2, 2026
+2,102
β291
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
e10164e
Add interactive selection for ambiguous package matches
AmelBawa-msft 1510821
Remove incorrect truncation guarantee from release notes
AmelBawa-msft d9263df
Fix spelling
AmelBawa-msft 0ef9010
Lock package selection tokens against localization
AmelBawa-msft 9b928b9
Resolve Unavailable once when building package choices
AmelBawa-msft b76321c
Always show sources in interactive package selection
AmelBawa-msft 5c4e8a6
Move package selection tests alongside prompt workflows
AmelBawa-msft ff053c7
Require selection argument before optional downgrade flag
AmelBawa-msft 9a8cef7
Replace package selection booleans with an explicit enum
AmelBawa-msft 6b35743
Restore considerPins argument comment in show command
AmelBawa-msft 42044ef
Use one-indexed wording in the package selection spec
AmelBawa-msft a3146a5
Clarify that multi-package flows do not prompt for selection
AmelBawa-msft 8aea5a2
Allow package selection prompts with silent installation
AmelBawa-msft 2082618
Build each package selection source row independently
AmelBawa-msft 4287666
Move selection prompting into a reusable PromptFlow task
AmelBawa-msft b85ba3b
Fix spelling check failures in selection spec and tests
AmelBawa-msft 34614f6
Remove redundant guidance from invalid selection feedback
AmelBawa-msft b6042c5
Move numbered selection prompt ownership into PromptFlow
AmelBawa-msft 643ef46
Derive the selection count from numbered table rows
AmelBawa-msft 9da01fa
Add typed integer prompting for numbered selection
AmelBawa-msft 743405e
Fix Ctrl+C teardown race in package selection prompts
AmelBawa-msft a124a7c
Add verbose logging when selection prompts are unavailable
AmelBawa-msft 4b94621
Restore the original interactivity comment
AmelBawa-msft 7f23ccc
Rename the prompt selection data key to SelectedIndex
AmelBawa-msft 4e13a17
Move integer range validation into Reporter
AmelBawa-msft 4fc9079
Always show package identity on selection source rows
AmelBawa-msft b4b914d
Represent continuation rows explicitly in table output
AmelBawa-msft 8052913
Make interactive package selection experimentally opt-in
AmelBawa-msft 64e144d
Avoid spelling false positives in prompt test inputs
AmelBawa-msft 77cdf03
Fix x86 signedness warnings in selection tests
AmelBawa-msft 24ca1a4
Use fixed feedback for numbered selection prompts
AmelBawa-msft 591f7bd
Reuse ambiguity tables for numbered package selection
AmelBawa-msft d729b8b
Use a shared title for interactive package selection
AmelBawa-msft 4ee3425
Make ambiguity table builders private to the workflow
AmelBawa-msft 71c25d8
Remove redundant operation gate from package selection
AmelBawa-msft a6c4a2c
Show refinement hints regardless of selection support
AmelBawa-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ aspirational | |
| Authenticode | ||
| AUTOLISTEN | ||
| azureedge | ||
| Bawa | ||
| binlog | ||
| binver | ||
| bstr | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| --- | ||
| author: AmelBawa-msft, GitHub Copilot <Copilot> | ||
| created on: 2026-09-28 | ||
| last updated: 2026-10-01 | ||
| issue id: 5345 | ||
| --- | ||
|
|
||
| # Interactive package selection | ||
|
|
||
| For [#5345](https://github.com/microsoft/winget-cli/issues/5345) | ||
|
|
||
| ## Abstract | ||
|
|
||
| Let users resolve ambiguous package matches without restarting their command. An experimental setting enables numbered choices for single-package `install`, `show`, and `download` when interactive input and output are available. | ||
|
|
||
| ## Inspiration | ||
|
|
||
| The same query can match multiple packages, including packages from different sources. Users should be able to choose deliberately without copying an ID into another invocation. | ||
|
|
||
| ## Solution Design | ||
|
|
||
| This feature is disabled by default. Enable it in settings: | ||
|
|
||
| ```json | ||
| { | ||
| "experimentalFeatures": { | ||
| "interactivePackageSelection": true | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| Apply existing search matching and source-priority rules first. If multiple candidates remain, eligible CLI call sites opt into selection. Shared workflows remain noninteractive by default. | ||
|
|
||
| Display candidates in their existing order with stable, one-indexed numbers. A valid number selects the existing package object without searching again. Preserve command options and continue normal version selection, applicability checks, and agreement handling. | ||
|
|
||
| | Situation | Behavior | | ||
| | --- | --- | | ||
| | Experimental feature disabled (default) | No selection prompts; retain ambiguity errors with refinement guidance. | | ||
| | No match | Existing no-match error. | | ||
| | One match after existing policy | Continue without prompting. | | ||
| | Multiple matches for single-package `install`, `show`, or `download` | Prompt if eligible, including `show --versions`. | | ||
| | Truncated results | Retain ambiguity error and request refinement. | | ||
| | Invalid or empty input | Explain the valid range and prompt again; no default. | | ||
| | `0` | Cancel without acting on a package. | | ||
| | Ctrl+C | Cancel immediately, including while waiting for input. | | ||
| | EOF or input failure | Report the existing prompt input error. | | ||
| | `--disable-interactivity`, interactivity disabled in settings or context | Retain ambiguity error without reading input. | | ||
| | `--silent` | Controls installer UI, not selection prompts; normal interactivity rules apply. | | ||
| | Redirected input or output, or disabled informational output | Do not prompt. | | ||
| | `--no-vt` | Use the same text and numeric input without terminal escape sequences. | | ||
| | Multi-package operations, including individual package contexts | No disambiguation prompts, either per package or up front; retain existing ambiguity errors. | | ||
| | Upgrade, uninstall, repair, pin, search, list, or completion | No selection prompts. | | ||
| | COM API, PowerShell cmdlets, or configuration/DSC | No new prompts or API changes. | | ||
|
|
||
| Apart from the experimental setting, the prompt adds no command-line flags, group policies, manifest fields, or schema versions. Existing interactivity controls and the experimental-features group policy apply. Package validation pipelines and manifest authoring tools are unchanged; manifest examples and schema snippets are not applicable. | ||
|
|
||
| ## UI/UX Design | ||
|
|
||
| Reuse the existing ambiguity table with a leading selection number. Show Name, Id, and Source, including Source when all candidates use the same source. For example: | ||
|
|
||
| ```text | ||
| Multiple packages match. Choose one. | ||
| # Name Id Source | ||
| ------------------------------------------ | ||
| 1 Contoso Editor Contoso.Editor winget | ||
| 2 Contoso Editor Contoso.Editor.Pro winget | ||
| Enter a number (1-2), or 0 to cancel: 1 | ||
| Selected: Contoso Editor [Contoso.Editor] | ||
| ``` | ||
|
|
||
| For distinct candidates from different sources: | ||
|
|
||
| ```text | ||
| # Name Id Source | ||
| --------------------------------------- | ||
| 1 Contoso Editor Contoso.Editor winget | ||
| 2 Contoso Editor Contoso.Editor private | ||
| ``` | ||
|
|
||
| Each candidate occupies one row, using the existing ambiguity report's package identity and source. Sources grouped within a candidate do not add rows. Use the same introductory text for every command. Do not add another confirmation after selection. Existing consent prompts still apply. | ||
|
|
||
| Ambiguity errors include the candidate list and refinement guidance, even when interactive selection is disabled: | ||
|
|
||
| ```text | ||
| Specify a package with --id <ID> --exact --source <SOURCE>. | ||
| ``` | ||
|
|
||
| For `configure export`, use `--package-id <ID> --source <SOURCE>` instead. | ||
|
|
||
| The original version option remains authoritative. | ||
|
|
||
| ## Capabilities | ||
|
|
||
| ### Accessibility | ||
|
|
||
| Numeric, line-oriented input works without color, cursor navigation, or arrow keys. All identifying information is text and uses localized labels. Invalid input includes recovery instructions. | ||
|
|
||
| ### Security | ||
|
|
||
| There is no default selection or inferred equivalence. Choosing a package does not accept agreements or bypass existing source, trust, or installer checks. | ||
|
|
||
| ### Reliability | ||
|
|
||
| Selection uses the displayed candidate object rather than re-running a potentially different search. EOF fails explicitly; cancellation never starts installation or download. | ||
|
|
||
| ### Compatibility | ||
|
|
||
| The feature is disabled by default. After opt-in, scripts can preserve ambiguity errors with `--disable-interactivity`, or avoid ambiguity with exact ID and source selectors. | ||
|
|
||
| ### Performance, Power, and Efficiency | ||
|
|
||
| Rendering uses available package metadata, without downloading manifests for display. No terminal redraw loop is required. | ||
|
|
||
| ## Potential Issues | ||
|
|
||
| Long candidate lists require scrolling. Narrow terminals truncate table cells using the existing formatter; users can widen the terminal or cancel and refine their query if candidates are indistinguishable. The selection message includes the full name and ID. Source-defined result truncation must not be presented as a complete selectable list. Matching names and IDs do not prove that packages from different sources are equivalent. | ||
|
|
||
| ## Future Considerations | ||
|
|
||
| Cross-source equivalence heuristics, arrow-key navigation, and selection for installed-package operations are separate changes. | ||
|
|
||
| ## Resources | ||
|
|
||
| - [Package matching background](%23292%20-%20winget%20should%20install%20an%20app%20if%20there%20is%20an%20exact%20match.md) | ||
| - [Settings reference](../Settings.md) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.