How microsoft/winget-cli works
WinGet is a Windows package manager: users discover packages from configured sources and can install, update, remove, download, or manage them. The CLI’s command and execution-context layers support those operations; repository search represents the package-discovery stage. The README also documents configuration, PowerShell cmdlets, and package-manager APIs. Source excerpts are limited, so links between individual commands, workflows, and repository operations are shown as unverified where their call sites were not sampled.
Main entry points: Command.h Command model · main.cpp WinGet CLI · ExecutionContext.h Execution context · RepositorySearch.h Search model
Components 21
CLI runtime
- WinGet CLI
src/AppInstallerCLI/main.cpp - Command model
src/AppInstallerCLICore/Command.h - Execution context
src/AppInstallerCLICore/ExecutionContext.h - Arguments
src/AppInstallerCLICore/Argument.h - Resume checkpoints
src/AppInstallerCLICore/CheckpointManager.cpp - Shell completion
src/AppInstallerCLICore/Workflows/CompletionFlow.cpp
Package management
- Install workflow
src/AppInstallerCLICore/Workflows/InstallFlow.cpp - Download workflow
src/AppInstallerCLICore/Workflows/DownloadFlow.cpp - Update workflow
src/AppInstallerCLICore/Workflows/UpdateFlow.cpp - Uninstall workflow
src/AppInstallerCLICore/Workflows/UninstallFlow.cpp - Repair workflow
src/AppInstallerCLICore/Workflows/RepairFlow.cpp - Package sources
src/AppInstallerRepositoryCore/RepositorySource.cpp - Search model
src/AppInstallerRepositoryCore/Public/winget/RepositorySearch.h
Configuration
- Configuration commands
src/AppInstallerCLICore/Commands/ConfigureCommand.cpp - Configuration workflow
src/AppInstallerCLICore/Workflows/ConfigurationFlow.cpp - Configuration remoting
src/ConfigurationRemotingServer/Program.cs
Client interfaces
- PowerShell cmdlets
src/PowerShell/Microsoft.WinGet.Client.Engine/Commands/WinGetPackageManagerCommand.cs - Deployment API
src/Microsoft.Management.Deployment/PackageManager.cpp - MCP server
src/WinGetMCPServer/Program.cs
Other components
- User
- Configured sources
Connections 18
- User → WinGet CLI: runs commands
README.md - WinGet CLI → Command model: dispatches
- Command model → Execution context: uses context
src/AppInstallerCLICore/Command.h - Execution context → Arguments: holds arguments
src/AppInstallerCLICore/ExecutionContext.h - Command model → Resume checkpoints: records resume
src/AppInstallerCLICore/CheckpointManager.cpp - Command model → Shell completion: dispatches completion
- Command model → Install workflow: dispatches install
- Command model → Download workflow: dispatches download
- Command model → Update workflow: dispatches updates
- Command model → Uninstall workflow: dispatches uninstall
- Command model → Repair workflow: dispatches repair
- Package sources → Search model: supports search
- Search model → Configured sources: queries packages
README.md - Command model → Configuration commands: dispatches configuration
- Configuration commands → Configuration workflow: uses workflow
- Configuration remoting → Configuration workflow: uses configuration
- PowerShell cmdlets → Deployment API: uses package manager
- MCP server → WinGet CLI: offers package tools