cargo-clean-global is a Cargo plugin that finds Cargo projects on your machine and cleans their build output directories in one command.
It is designed as the practical equivalent of a global Cargo clean operation. Because Cargo plugins cannot extend the built-in cargo clean command with a --global flag, this project is used as:
cargo clean-globalDirect execution via cargo-clean-global is intentionally rejected. Use the Cargo subcommand form only.
cargo install cargo-clean-globalInstall from a local checkout during development:
cargo install --path .Clean all discovered Cargo project build directories:
cargo clean-globalSkip the confirmation prompt and clean immediately:
cargo clean-global --yesPreview what would be cleaned without deleting anything:
cargo clean-global --dry-runRestrict scanning to a specific directory:
cargo clean-global --root ~/projectsRestrict scanning to multiple directories:
cargo clean-global --root ~/projects --root /work/rustBy default, scanner skips hidden directories whose names start with ..
If your Rust project is inside a hidden directory, explicitly pass that path with --root.
Example:
cargo clean-global --root ~/.config/my-rust-projectsShow help:
cargo clean-global --helpContributions of any kind are welcome! If you have ideas or suggestions, feel free to open an issue or submit a pull request.
Pushing a version tag that matches v<package-version> runs the release workflow, builds the release artifacts, creates the GitHub Release, and publishes the crate to crates.io.
Repository maintainers must configure the CRATES_IO_TOKEN GitHub Actions secret before using this flow.
MIT License © 2026 Clover You