Repository navigation
JSON Formatted Output Support #184
Copy link
Copy link
Labels
Issue-FeatureThis is a feature request for the Windows Package Manager client.This is a feature request for the Windows Package Manager client.
Description
Relevant area(s)
- WinGet CLI
Description of the new feature / enhancement
Parent / tracking issue for structured, machine-readable output in WinGet.
To enable automation and consumption by other tools, WinGet commands should be able to emit structured output (e.g. JSON) in addition to the default human-readable tables. Parsing the default console output is brittle; a stable structured format lets scripts and tools consume results reliably.
This issue tracks the overall effort; individual slices are tracked as sub-issues / related work below.
Scope
- A consistent
--format json(and potentially other structured formats) across commands that produce output — e.g.list,upgrade,search,show,export. - A stable, documented schema for each command's structured output.
- Where appropriate, keep the shape of the structured output (field names and structure) aligned with the objects returned by the WinGet PowerShell module, so consumers get a consistent schema across the CLI and the module rather than two divergent shapes.
- Well-defined behavior for empty results and error paths so output stays parseable.
Related work and sub-issues
- In flight: PR Add JSON format for list outputs #6346 adds
--format jsonforlistandupgrade(list-only) output. - Provide Structured Data Format Options #1753 (closed) — original request for structured format options on
list/upgrade; covered by the work above. - More package information in Exported JSON file #2030 — richer package information in
winget exportJSON output (export payload).
Out of scope (separate concerns)
- Output verbosity — how much WinGet prints to the console (tracked in Client Verbosity Settings #161).
- Diagnostic log level — a distinct concern from output format.
Updated with GitHub Copilot.
Reacted by aslze, Curtis Carter, Callum Tolley, oxygen dioxide, Kevin Marquette, minzdrav, aetos, Drew, Max Jakobitsch, Chris Donnelly and 46 more
Reacted by Mike MacCana
Metadata
Metadata
Assignees
Labels
Issue-FeatureThis is a feature request for the Windows Package Manager client.This is a feature request for the Windows Package Manager client.
Activity
mikemaccana commentedon May 23, 2020
Modern Windows command line apps are in powershell, and already output structured objects. These can already be converted to JSON, Excel, CSV, or whatever other format is preferred.
The issue is that winget is unique, in that it doesn't output any structured data. #196 was created to address this issue but it was closed.
RichiCoder1 commentedon May 23, 2020
Mike MacCana (@mikemaccana) As mentioned on the other two issues, PowerShell isn't available in all Windows SKUs which this is targeting. For native PowerShell support, you're looking for #221.
megamorf commentedon May 23, 2020
Richard Simpson (@RichiCoder1) Could you list all target SKUs and/or a link to the requirements spec, please?
RichiCoder1 commentedon May 23, 2020
It's been mentioned multiple times across multiple sources:
denelon commentedon Aug 6, 2021
Richard Simpson (@RichiCoder1) I'm going through the backlog as a part of our planning exercise for the next few milestones. I'm going to close this as a Duplicate of #221.
RichiCoder1 commentedon Aug 6, 2021
I'm cool with that as long as the ultimate functionality is still flexible enough to be consumed from other tools
denelon commentedon Aug 6, 2021
Yes, that is the intent. Rather than building some kind of
--output-JSONflag, the native PowerShell implementation will provide objects that may be used, and will not have the truncated output string behavior currently exhibited in the winget.exe client.mikemaccana commentedon Aug 6, 2021
stknohg commentedon Oct 28, 2021
Demitrius Nelon (@denelon) PowerShell isn't the only Windows shell.
For example, I also use nushell, some users use git bash, and some users still use the command prompt.
I strongly hope to implement the json output parameter (like
--output-JSON).mikemaccana commentedon Oct 28, 2021
stknohg commentedon Oct 28, 2021
I think It feels very wasteful to call powershel.exe or pwsh.exe every time I use winget on non-PowerShell shell.
denelon commentedon Mar 27, 2024
I'm going to re-open this issue. It's not high-priority (unless we see a lot of 👍) since we have the option in PowerShell, but I can see value in what is being asked for.
We still have more work to completely move everything the CLI is calling into the COM APIs, and once that's done, providing some kind of output type/format "should" be a bit easier to implement.
Banthaf0dder commentedon Apr 9, 2024
I'd like to note one thing in reference to powershell. Until the winget powershell module can be used in system context there is a gap in functionality that could be filled if winget output could be json formatted. That would make converting winget output to a powershell object very easy.
sam-bryant commentedon Dec 11, 2024
Can we get an update on this? It would be a very beneficial feature to output structured data like most other modern cli's.
denelon commentedon Dec 17, 2024
Hey everyone, we've been publishing the Microsoft.WinGet.Client PowerShell module for the last several months with each WinGet release. It now works on Windows PowerShell and it works in system context (depending on the installer one is trying to use, and the scope is "System").
svrooij commentedon Jun 4, 2025
This sounds nice, but is it is not installed with WinGet and it is
19MB. I still feel that just outputting everything as json would still be a better solution.jo-chemla commentedon Sep 16, 2025
This thread shows there is some strong interest in JSON ready output for winget CLI commands like
list, showetc - or probably any native machine-readable format - the raw package manifests yaml format included.For anyone interested in the powershell workaround, here is a link to a example documentation - execute the below in powershell admin terminal to install the module and play with it.
Unfortunately, there do not seem to be an equivalent PowerShell cmdlet to the
winget showCLI which would dumpInstaller Url, moniker, Licenseetc, so these attributes would have to be parsed from raw console output via eg the below snippet