Mole icon indicating copy to clipboard operation
Mole copied to clipboard

[FEATURE] Selective clean (run only specific sections)

Open spider-yamet opened this issue 8 months ago • 1 comments

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> or mo clean --sections "caches,browsers".
  • Sections could map to current groups, e.g.:
    • caches – user app cache, sandboxed app caches, macOS system caches
    • browsers – browser caches
    • dev – developer tools
    • system – deep system (if sudo available)
    • trash – trash only
    • etc.
  • --dry-run and --whitelist behave as today; no new deletion rules.
  • Help text lists available sections (e.g. mo clean --only help or in mo clean --help).

Alternatives considered

  • Separate subcommands per category: Would duplicate logic and bloat the CLI; a single clean with --only keeps one code path.
  • Config file to disable sections: Possible future extension; --only is 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 avatar Mar 06 '26 16:03 spider-yamet

@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.

tw93 avatar Mar 07 '26 12:03 tw93