smartpub 1.0.5
smartpub: ^1.0.5 copied to clipboard
Smart Flutter dependency analyzer that cleans and organizes pubspec.yaml by detecting unused, misplaced, and duplicate dependencies.
π¦ SmartPub - Flutter Dependency Analyzer #
The smart way to manage Flutter dependencies.
SmartPub is a CLI tool for Flutter & Dart projects that helps you identify unused dependencies and organize your pubspec.yaml in a clean, predictable way.
Over time, Flutter projects often accumulate unused or poorly organized packages. SmartPub makes it easy to preview, clean, and categorize dependencies without risking accidental changes.
π€ Why SmartPub? #
In real Flutter projects:
- Unused packages increase build time and maintenance cost
pubspec.yamlbecomes hard to read as dependencies grow- Developers hesitate to clean dependencies due to fear of breaking the app
SmartPub solves this by:
- Detecting unused dependencies safely
- Providing preview-first workflows
- Offering interactive modes before making changes
- Keeping actions explicit and predictable
No magic. No hidden behavior.
β¨ What SmartPub Does #
SmartPub focuses on two core features only:
1οΈβ£ Unused Dependency Detection #
- Scans your project source code
- Detects unused dependencies
- Allows preview before removal
- Supports interactive confirmation
2οΈβ£ Dependency Categorization (beta) #
Powered by FlutterGems
- Groups dependencies into logical categories
- Uses known ecosystem data
- Supports preview, auto-apply, and interactive overrides
π Installation #
Global installation (recommended) #
dart pub global activate smartpub
Make sure Dartβs global bin is in your PATH.
π§ Usage Overview #
smartpub [command] [options]
If no command is provided, SmartPub runs in preview mode.
π Commands #
check (default) #
Preview unused dependencies (read-only).
smartpub
smartpub check
β No files are modified.
clean #
Remove unused dependencies.
smartpub clean
Interactive cleanup
Review each removal before applying changes.
smartpub clean --interactive
A backup of pubspec.yaml is created automatically.
group #
Preview dependency categorization.
smartpub group
Apply categorization automatically
smartpub group --apply
Interactive categorization
Override suggested categories interactively.
smartpub group --interactive
This is useful when you want full control over how packages are grouped.
restore #
Restore pubspec.yaml from the last backup.
smartpub restore
update #
Update SmartPub to the latest version.
smartpub update
βοΈ Options #
--apply Apply changes automatically
--interactive Review and confirm changes interactively
--no-color Disable colored output (CI-friendly)
-h, --help Show help information
-v, --version Show version information
π§ͺ Typical Workflow #
A safe and recommended workflow:
smartpub # preview unused dependencies
smartpub clean # remove unused dependencies
smartpub group # preview categorization
smartpub group --interactive
This keeps changes intentional and reviewable.
π‘οΈ Safety Guarantees #
- SmartPub never modifies files without intent
- Preview is the default behavior
- Backups are created before changes
- Interactive mode is available for sensitive operations
π¦ Project Scope (Important) #
SmartPub intentionally does not:
- Modify versions automatically
- Upgrade or downgrade dependencies
- Guess architectural intent
Its goal is clarity and cleanliness, not automation overload.
π Support #
- π GitHub
- π Report Issues
- π‘ Feature Requests
Made with β€οΈ by Vatsal Jaganwala