image_cleaner_cli 0.0.2 copy "image_cleaner_cli: ^0.0.2" to clipboard
image_cleaner_cli: ^0.0.2 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 #

image_cleaner_cli 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-run mode 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 /assets folder
  • 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 #

  1. Run the CLI (without --dry-run)
  2. A local server opens in your browser (localhost:8080)
  3. Unused images are displayed in grid format
  4. Select images you want to delete
  5. 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 #

GitHub โ€“ image_cleaner_cli


๐Ÿ‘จโ€๐Ÿ’ป Maintainer #

Built with โค๏ธ by Sumit Dabral


๐Ÿ’ซ If this project helped you, do consider giving it a โญ๏ธ โ€” it motivates further development!

4
likes
0
points
18
downloads

Publisher

verified publishersumitdabral.space

Weekly Downloads

A Dart CLI tool to detect, preview, and delete unused or unwanted image assets from your Flutter project.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

args, path

More

Packages that depend on image_cleaner_cli