3 releases
Uses new Rust 2024
| 0.1.2 | Mar 17, 2026 |
|---|---|
| 0.1.1 | Mar 5, 2026 |
| 0.1.0 | Mar 5, 2026 |
#768 in Filesystem
81KB
2.5K
SLoC
🦀 Cargo Target Scanner
A tool to scan, visualize, and clean up Rust project target directories, helping you reclaim disk space. Supports both GUI and CLI modes.
Features
- Dual Mode — CLI by default; use
--guito launch the desktop GUI - Recursive Scanning — Recursively scan a directory tree to find all Rust projects with
targetfolders - Size Visualization — Display each project's
targetdirectory size with color-coded indicators (green → red) - Build Target Details — Show individual build targets (
debug,release, cross-compilation targets) with sizes - Selective Deletion — Select whole projects or individual build targets for deletion
- Async Deletion — Delete operations run in a background thread with a loading overlay (GUI)
- Toast Notifications — Success/failure toast messages after deletion (GUI)
- Search & Sort — Filter projects by name or path; sort by size or name
- i18n — Supports Chinese and English, switchable at runtime (GUI, default: Chinese)
- WeUI Design — Clean, modern UI following WeChat WeUI design guidelines (GUI)
Tech Stack
- Rust
- Dioxus 0.7 (Desktop)
- clap — Command-line argument parsing
- rfd — Native file dialog
- Tokio — Async runtime
Requirements
- Rust 2024 edition (1.85+)
- macOS / Linux / Windows
Installation
From crates.io
cargo install cargo-target-scanner
From source
git clone https://github.com/TtTRz/cargo-target-scanner.git
cd cargo-target-scanner
cargo build --release
Usage
CLI Mode (default)
By default, the tool runs in CLI mode and only scans (no deletion).
# Scan home directory (scan only)
cargo run
# Scan a specific path
cargo run -- --path /path/to/projects
# Scan and interactively select targets to delete
cargo run -- --delete
# Delete all targets without prompting
cargo run -- --delete-all
# Sort by name instead of size
cargo run -- --sort-name
GUI Mode
cargo run -- --gui
# or
./target/release/cargo-target-scanner --gui
- Set the scan root directory (defaults to
$HOME) - Click Start Scan to find all Rust projects with
targetdirectories - Browse projects sorted by size; use the search bar to filter
- Select projects or individual build targets (debug / release / cross-compilation)
- Click Delete and confirm to clean up selected targets
- Click the 🌐 button in the top-right corner to switch between Chinese and English
Options
| Flag | Description |
|---|---|
--gui |
Launch GUI mode |
-p, --path <PATH> |
Scan root path (defaults to $HOME) |
--delete |
Enable interactive deletion (CLI) |
--delete-all |
Delete all found targets without prompting (CLI) |
--sort-name |
Sort by name instead of size (CLI) |
-h, --help |
Print help |
-V, --version |
Print version |
License
MIT
Dependencies
~20–72MB
~1M SLoC