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.
Libraries
- cleaners/android_cleaner
- cleaners/apple_cleaner
- cleaners/cleaner
- cleaners/flutter_project_cleaner
- cleaners/system_cleaner
- commands/analyze_command
- commands/base_command
- commands/cache_command
- commands/clean_command
- commands/context
- commands/doctor_command
- commands/init_command
- commands/runner
- commands/scan_command
- fclean
- models/app_config
- models/cleanup_result
- models/cleanup_target
- models/doctor_check
- models/scan_result
- services/cleaning_service
- services/config_service
- services/doctor_service
- services/file_system_service
- services/platform_service
- services/process_service
- services/scanner_service
- services/terminal_service
- utils/byte_format
- utils/exceptions
- utils/path_safety