image_cleaner_cli 0.0.3
image_cleaner_cli: ^0.0.3 copied to clipboard
A Dart CLI tool to detect, preview, and delete unused or unwanted image assets from your Flutter project.
๐งผ image_cleaner_cli #
A Dart CLI tool to detect, preview, and delete unused image assets from your Flutter project.
Easily identify unused images and clean them up using a local interactive HTML preview!
โญ๏ธ If you find this useful, consider giving it a GitHub star โ it helps others discover the project!
๐ฌ Demo #

๐ธ The CLI detects unused images and spins up a local HTML preview for you to review and delete them safely.
โ Features #
- ๐ Detect unused images inside your Flutter project
- ๐งช
--dry-runmode to safely list images without deleting - ๐ Starts a local HTML preview to review and delete unused assets
- ๐ ๏ธ Simple CLI interface, no complex setup
- โก Works cross-platform (Windows, macOS, Linux)
๐ Installation #
Activate from your local clone (or globally if published):
dart pub global activate --source path .
Or run directly from local:
dart run bin/image_cleaner_cli.dart
๐ฆ Usage #
Show help
dart run bin/image_cleaner_cli.dart --help
Dry run (safe mode โ no deletion)
dart run bin/image_cleaner_cli.dart --dry-run
Full run (with browser preview and deletion)
dart run bin/image_cleaner_cli.dart
This will:
- Scan your
/assetsfolder - Analyze image usage across Dart files
- Launch a local HTML page (typically
http://localhost:8080) - Let you preview and select images for deletion
- Delete selected images after your confirmation
๐ผ๏ธ HTML Preview Flow #
- Run the CLI (without
--dry-run) - A local server opens in your browser (localhost:8080)
- Unused images are displayed in grid format
- Select images you want to delete
- Click the delete button โ and done โ
๐ Safe and manual: No image is deleted unless you choose it in the browser.
๐ก Example Output #
Dry run sample:
๐ Using folder: /your/flutter/project
๐งช Performing dry run...
๐๏ธ Found 4 unused images:
- assets/images/old_logo.png
- assets/icons/unused_icon.svg
- assets/images/temp/banner.jpg
- assets/icons/trash.png
๐ ๏ธ CLI Options #
| Flag | Alias | Description |
|---|---|---|
--dry-run |
-d |
List unused images without deleting them |
--help |
-h |
Show help and usage information |
๐ Project Expectations #
This tool assumes:
- You use a Flutter project
- Image assets are stored inside the
assets/folder - Images are referenced directly via strings in your Dart files
๐ Version #
Current Version: 0.0.2
๐ Repository #
๐จโ๐ป Maintainer #
Built with โค๏ธ by Sumit Dabral
๐ซ If this project helped you, do consider giving it a โญ๏ธ โ it motivates further development!