Add package maintenance commands: autoremove, clean, cache purge and cache management and doctor.

Open
#6,623 0 comments 2 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
cpp
Domain
cli

Research direction

This is a large feature request bundling several commands (autoremove, clean, cache management, doctor) with no implementation detail about where cache or dependency tracking lives in the codebase. Start by reading how existing commands are registered under src/AppInstallerCLICmds and how the installer cache directory is managed, then discuss scope with maintainers — this likely needs design work and maintainer buy-in before any code. Done would mean accepted command specs and then incremental implementation.

Written by the indexing model from the issue text.

Description

Issue-Feature Needs-Triage
Relevant area(s)

WinGet CLI

Description of the new feature / enhancement

Please add the following maintenance commands to WinGet:

  1. winget autoremove : Remove unused dependencies.
  2. winget clean: Clean temporary files and old installer data.
  3. winget cache: Show cache size and location.
  4. winget cache list: List cached installers.
  5. winget cache remove: Remove cache for a specific package.
  6. winget cache purge: Remove all cached installers.
  7. winget cache reset --force: Reset and rebuild the cache.
  8. winget doctor: Checks corrupted cache, broken package registrations, source issues, and installation problems.

Benefits:

  • Saves disk space.
  • Simplifies package maintenance.
  • Better for power users and developers.
Proposed technical implementation details
  • Track downloaded installer cache.
  • Track package dependencies installed through WinGet.
  • Add safe cleanup and dependency removal.
  • Support --whatif for previewing changes.
  • Display reclaimed disk space after cleanup.
  • Support JSON output for automation.

Example:

winget autoremove --whatif winget clean --whatif winget cache purge --whatif

Add:

winget doctor

Checks:

  • Corrupted cache
  • Broken package registrations
  • Source issues
  • Installation problems
Dominant language
C++
Stars
26.6k
Forks
1.8k
Avg merge
3d 10h
Merged PRs (30d)
41

Getting set up

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.

More from microsoft/winget-cli

All issues in microsoft/winget-cli

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.