microsoft / microsoft/winget-cli

Rich queries for winget packages with JMESPath

Open
#1,593 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Feature
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

Description of the new feature/enhancement

winget can currently query packages by:

  • id
  • name
  • moniker
  • tag
  • command

which is nice, but there will never be enough parameters and "expressiveness" within them to be able to really drill down into all package attributes and get precisely what one wants. The winget manifests are JSON or JSON-compatible YAML, so let us query the entire schema through JMESPath expressions/filters with a single parameter.

Proposed technical implementation details (optional)

JMESPath is a standard and there are many libraries available. The Azure CLI already implements it for querying azure resources, here's a MSFT article about that.

JMESPath allows to effortlessly query nested attributes, specify ranges, compare numbers, check for presence of an attribute, combine or restructure data etc. etc.. It's the one-stop solution for all package querying needs now and in the future as it evolves with the schema. For users wanting to use only basic search functionality the existing parameters will be preserved as-is.

I propose the subcommand winget filter as that would tie in nicely with #1407 because -Filter is a common parameter name for PowerShell for specifying resource-specific and resource-provider-impemented advanced filters and queries like would be the case here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or implementation entry points. Start by reviewing how the existing id, name, moniker, tag, and command queries are handled, then read the proposed winget filter direction and related issue #1407; done would mean a settled design for JMESPath queries over package manifests while preserving existing search parameters.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, search
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.