$ show momenbasel/PureMac
PureMac is a free, open-source macOS system cleaner and app uninstaller built as a native SwiftUI application (targeting macOS 13.0+). It provides a graphical interface and a companion CLI tool for scanning and removing junk files, uninstalling applications with full leftover cleanup, finding orphaned files, and performing scheduled maintenance. The system is architected with an MVVM-like pattern: a central `AppState` ObservableObject drives all UI state, while modular actors (`ScanEngine`, `CleaningEngine`, `BinaryThinner`) handle async scanning and cleaning operations with safety checks (path allowlists, symlink resolution, trash-only deletion). The app uses a 10-level heuristic to match app files, scans 12+ categories (system junk, user cache, Xcode, Homebrew, Docker, AI apps, etc.), and integrates with macOS services like Full Disk Access, Finder Services, Menu Bar, and Sparkle auto-updates. The CLI is a separate Swift package with its own set of commands (clean, purge, analyze, optimize, ignore, config) that reuses similar logic, ensuring consistency between GUI and terminal workflows. The codebase is well-structured, fully internationalized (10+ languages), and distributed via Homebrew and GitHub releases with a full CI/CD pipeline for signing and notarization.
The LLM identified 4 files worth highlighting for reuse:
A custom SwiftUI view that renders a confetti particle burst animation using CAEmitterLayer integrated with UIViewRepresentable. It is self-contained, uses @Environment for accessibility (reduce motion), and can be extracted into any macOS/iOS app to celebrate events (e.g., cleaning completion). Demonstrates advanced UIKitβSwiftUI interop and particle system design.
A collection of reusable SwiftUI chart components including HealthRing, StorageDonut, CategoryBarChart, ScanningGauge, CountUpBytes, and StaggeredReveal. These are fully self-contained, use SwiftUI animations and geometry readers, and can be extracted to visualize disk usage or scan progress in any macOS app. Demonstrates sophisticated SwiftUI drawing and animation patterns.
A struct that defines the safety policy for orphan file deletion, containing an allowlist of volatile directories (e.g., temp, caches) and a denylist of high-risk paths (e.g., system directories, cloud provider storage). It uses symlink resolution and file protection checks. The logic is isolated, parameterized, and could be extracted as a reusable safety rule engine for any macOS file cleanup tool.
A structured logging utility wrapping os.Logger with an in-memory entry store exposed to the UI via @MainActor. Supports log levels, file/line context, and a @Published array for live log viewing. The pattern is self-contained, thread-safe, and can be extracted into any Swift project requiring in-app log display or diagnostics.