fclean 0.2.0
fclean: ^0.2.0 copied to clipboard
A cross-platform CLI for safely cleaning Flutter build, cache, and system artifacts.
fclean #
fclean is a cross-platform Dart CLI for safely finding and removing Flutter build artifacts, development caches, and local system clutter.
Commands #
fclean scan
fclean analyze --top 15
fclean clean --interactive
fclean clean --dry-run
fclean clean --include flutter --yes
fclean cache gc
fclean doctor
fclean init
Architecture #
The package is split into thin command classes and reusable services:
lib/commands: CLI argument parsing and orchestration.lib/cleaners: cleanup target discovery for Flutter, Android, Apple, and system files.lib/services: platform, filesystem, scanning, process, config, and terminal abstractions.lib/models: strongly typed result and config objects.lib/utils: byte formatting, path safety, and shared exceptions.
Destructive operations go through path validation, support --dry-run, and require confirmation unless --yes is provided.
Interactive Cleaner #
Use fclean clean --interactive for a guided menu:
- Clean Flutter build folders
- Run
flutter cleanon projects - Clean Gradle cache
- Clean CocoaPods
- Clean Xcode DerivedData
- Clean Android build cache
- Clean iOS simulators
- Clean Homebrew cache
- Empty Trash
- Clean temporary files
- Run
flutter pub cache gc - Full cleanup
- Show largest folders
- Toggle dry run mode
The menu first asks whether to scan the current directory, a custom directory, or the whole system. Whole-system scans prune protected macOS/system folders automatically.
Config #
Run fclean init to create:
clean:
gradle: true
xcode: true
cocoapods: true
trash: false
Roadmap #
TODO: JSON reports, CI mode, scheduled cleanups, telemetry hooks, plugin cleaners, GUI wrapper, and named config profiles.