[FEATURE] Selective clean (run only specific sections)
Feature description
Allow users to run only selected sections of mo clean (e.g. only caches, only browsers, only developer tools) via a flag like --only <category> or --sections. No new cleanup logicâonly filtering which of the existing sections run.
Use case
Sometimes users want to clean one area (e.g. browser caches) without running the full clean. Today they must run the whole flow or skip interactively. A focused run (e.g. mo clean --only browsers or mo clean --only caches) is faster, easier to script, and keeps Moleâs behavior predictable and transparent.
Proposed solution
- Add a flag, e.g.
mo clean --only <section>ormo clean --sections "caches,browsers". - Sections could map to current groups, e.g.:
cachesâ user app cache, sandboxed app caches, macOS system cachesbrowsersâ browser cachesdevâ developer toolssystemâ deep system (if sudo available)trashâ trash only- etc.
--dry-runand--whitelistbehave as today; no new deletion rules.- Help text lists available sections (e.g.
mo clean --only helpor inmo clean --help).
Alternatives considered
- Separate subcommands per category: Would duplicate logic and bloat the CLI; a single
cleanwith--onlykeeps one code path. - Config file to disable sections: Possible future extension;
--onlyis simpler and doesnât require config file changes.
Additional context
- Stays âlightweight and focusedâ: same cleanup rules, only a filter on which sections run.
- No time-based or new risky logic; all existing safeguards apply.
@spider-yamet Thanks for the suggestion. I understand the use case, but for Mole I want to keep mo clean as simple and direct as possible, and avoid adding more grouping options or extra configuration. If there are items users do not want cleaned, the current whitelist support is the better fit for now.