Rust Cleaner is a small command-line tool that recursively scans a base
directory, finds Rust projects, and cleans their target directories.
A directory is treated as a Rust project when it contains a Cargo.toml file.
The scanner walks the full directory tree, so nested Rust projects are also
detected. When a Rust project has a target directory, Rust Cleaner removes the
contents of that directory while keeping the target directory itself.
- Recursively scans from any base directory.
- Detects Rust projects by
Cargo.toml. - Handles Rust projects nested inside other Rust projects.
- Skips scanning inside
targetdirectories. - Shows an interactive TUI with scan progress, events, counters, and cleaned project results.
- Supports plain console output for scripts and CI.
Build from source:
cargo build --releaseThe compiled binary will be available at:
target/release/rust_cleanerRun with the interactive TUI:
cargo run -- /path/to/base/directoryOr run the compiled binary directly:
./target/release/rust_cleaner /path/to/base/directoryUse plain console output instead of the TUI:
cargo run -- --plain /path/to/base/directoryShow help:
cargo run -- --helpGitHub Actions builds release archives for:
- Linux x86_64
- macOS x86_64
- macOS aarch64
Push a version tag to create a GitHub release:
git tag v0.1.0
git push origin v0.1.0Rust Cleaner removes files and directories inside each matched target
directory. It does not remove the target directory itself and does not clean
target directories in folders that are not detected as Rust projects.
This project is licensed under the MIT License. See LICENSE.