Search

PythonReactSEOPDF
GitHub Skill

cargo-shear

Finds and removes unused dependencies from Rust projects. Use when cleaning up a Rust repository, removing dead deps, or auditing Cargo.toml.

onbjerg☆ 4 Repository stars1 Repository forks

Installation

Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.

View source ↗Guides

Skill instructions

cargo-shear

Detects and removes unused dependencies from Cargo.toml files.

Usage

Find unused dependencies
cargo shear
Fix automatically (remove unused deps)
cargo shear --fix

Key Options

  • --fix - Automatically remove unused dependencies from Cargo.toml
  • --ignore <CRATE> - Ignore specific crate (for false positives)

Workflow

  1. Run cargo shear to list unused deps
  2. Review the output for false positives (proc macros, build deps, optional features)
  3. Run cargo shear --fix to remove them
  4. Run cargo build to verify nothing broke

Common False Positives

Some deps may appear unused but are actually needed:

  • Proc macro crates (e.g., serde_derive)
  • Build dependencies
  • Crates used only via feature flags
  • Crates re-exported by other crates

Use --ignore <CRATE> for legitimate false positives.

Examples

Read the usage examples in the source repository.

View source ↗

Source history

Indexed on
2026-01-20
Index updated
2026-03-03
Branch
main

Index and sync dates describe this directory. View the source repository for code history.

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!