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/rustConfigure default scan roots in your global Cargo config (used when --root is not provided):
$CARGO_HOME/config.toml (or $CARGO_HOME/config).
In most setups, this is ~/.cargo/config.toml.
[cargo-clean-global]
roots = ["~/projects", "../rust-workspaces"]You can also set a single string value:
[cargo-clean-global]
roots = "~/projects"Root precedence:
--rootvalues passed on CLI[cargo-clean-global].rootsfrom global Cargo config- Built-in defaults (home/current directory strategy)
Path behavior for [cargo-clean-global].roots:
~is expanded to your home directory.- Relative paths are resolved relative to the Cargo config file directory.
By 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.
Install the local release helpers:
cargo install cargo-release
cargo install git-cliff
brew install justPrepare and verify a release without pushing anything:
just release-dry-run 1.2.5Create the release commit and tag locally:
just release 1.2.5Create the release commit, tag, and push them to origin:
just release-execute 1.2.5Pushing 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. The release workflow publishes to crates.io only after the GitHub Release and its binary artifacts are created.
Repository maintainers must configure the CRATES_IO_TOKEN GitHub Actions secret before using this flow.
MIT License © 2026 Clover You