CARGO-MACHETE(1)

πŸ“¦ version 0.9.2, in ubuntu stonking

πŸ‘‘ CARGO-MACHETE(1) πŸ‘‘

okay bestie, welcome to the User Commands section, this is cargo-machete, and she is that girl πŸ’…


✨ NAME ✨

cargo-machete β€” find unused dependencies in Rust projects πŸ¦‹


✨ SYNOPSIS ✨

cargo-machete [OPTIONS] [PATH]

✨ DESCRIPTION ✨

so cargo-machete is the bestie who goes through your Rust project and finds the unused dependencies for you, and she does it fast but also imprecise β€” like, she's not a perfectionist, she's a vibe, and honestly? iconic behavior πŸ’–

run her in a directory that has one or more Rust projects using Cargo for dependency management. if you don't hand her any paths at all, she just defaults to the current working directory, no questions asked, main character energy fr fr ✨


✨ OPTIONS ✨

  • --with-metadata β€” this one uses cargo-metadata to figure out what the dependencies are actually named. lowkey a lifesaver if some deps got renamed from their own Cargo.toml file (say it with me: xml-rs which gets renamed to xml πŸ‘€). try it if you keep getting false positives, bestie!
  • --skip-target-dir β€” does NOT analyze anything chillin' inside any target/ directories she runs into. respect the target dir, she's not going there 🚫
  • --fix β€” rewrites the Cargo.toml files and automatically removes the unused dependencies for you. so generous. so helpful. πŸŽ€
⚠️ okay queen, hear me: all dependencies flagged by cargo-machete get removed, and that includes the false positives. she is not double-checking. the vibes are the vibes πŸ’€
  • --no-ignore β€” also searches in ignored files (.gitignore, .ignore, etc.) when she's out here searching for files. nothing escapes her πŸ•΅οΈβ€β™€οΈ
  • --version β€” prints the version. simple. slay.
  • --help, help β€” displays usage information, the classic 🫢

✨ EXIT STATUS ✨

cargo-machete returns these exit codes and you will respect them:

  1. 0 β€” when no unused dependencies are found πŸŽ‰ clean, immaculate, no notes
  2. 1 β€” when at least one unused (non-ignored) dependency is found 😭 she caught one
  3. 2 β€” on error πŸ’€ something went wrong bestie

✨ AUTHOR ✨

this manual page was written by Ching He <heqing@rool.me> for the Debian project (and may be used by others) 🫢


and that's the whole thing, bestie! 🌸 this page is from cargo-machete in the User Commands section, dated June 2026 β€” no cap, go forth and delete those unused deps πŸ’–βœ¨πŸ‘‘

πŸ“¦ where this page comes from