🧠 cargo-sane
Stop losing your mind over Rust dependency conflicts.
cargo-sane is a command-line tool that helps you manage Rust dependencies intelligently. It checks for updates, categorizes them by severity, and updates them interactively.
✨ Features
- 🔍 Smart Dependency Analysis - Scans your
Cargo.tomland checks crates.io for updates - 📊 Categorized Updates - Separates updates into patch, minor, and major versions
- ⚡ Interactive Updates - Select which dependencies to update with a beautiful TUI
- 🎨 Beautiful Output - Color-coded, easy-to-read terminal interface
- 💾 Safe Updates - Automatic backup before making changes
- 🚀 Fast - Concurrent API calls with progress indicators
📦 Installation
Or build from source:
🚀 Usage
Check for Updates
Analyze your dependencies and see what's available:
Example output:
🧠 cargo-sane check
ℹ Package: my-project
ℹ Manifest: /path/to/Cargo.toml
📊 Update Summary:
✅ Up to date: 3
🟢 Patch updates available: 5
🟡 Minor updates available: 2
🔴 Major updates available: 1
🟢 Patch updates:
• serde 1.0.195 → 1.0.228
• anyhow 1.0.89 → 1.0.100
🟡 Minor updates:
• tokio 1.35.0 → 1.47.2
🔴 Major updates:
• colored 2.1.0 → 3.0.0
Run `cargo sane update` to update dependencies interactively.
Update Dependencies
Update dependencies interactively:
This will:
- Show you all available updates
- Let you select which ones to apply (spacebar to select, enter to confirm)
- Update your
Cargo.toml(with automatic backup) - Preserve all formatting, comments, and features
Update all dependencies automatically:
Dry run (preview without changing):
Verbose Mode
Get detailed information about updates:
Specify Cargo.toml Path
Work with a specific manifest:
📋 Commands
| Command | Description | Status |
|---|---|---|
check |
Analyze dependencies and show available updates | ✅ Available |
update |
Update dependencies interactively | ✅ Available |
fix |
Fix dependency conflicts | 🚧 Coming soon |
clean |
Remove unused dependencies | 🚧 Coming soon |
health |
Check for security vulnerabilities | 🚧 Coming soon |
🎯 Why cargo-sane?
Managing Rust dependencies can be frustrating:
- 😤 Manually checking for updates is tedious
- 😵 Version conflicts are confusing
- 😱 Breaking changes can break your build
- 🤯 No easy way to see what changed
cargo-sane solves this:
- ✅ Automatically checks all dependencies
- ✅ Shows you exactly what will change
- ✅ Categorizes updates by risk (patch/minor/major)
- ✅ Lets you choose what to update
- ✅ Creates backups automatically
- ✅ Works with all Cargo.toml formats
🛡️ Safety Features
- Automatic Backup: Creates
Cargo.toml.backupbefore any changes - Dry Run Mode: Preview changes without modifying files
- Format Preservation: Keeps your formatting, comments, and structure
- Selective Updates: Choose exactly which dependencies to update
📊 Supported Cargo.toml Formats
cargo-sane handles all dependency formats:
# Simple
= "1.0"
# With features
= { = "1.35", = ["full"] }
# Optional dependencies
= { = "4.5", = true }
# With comments (preserved!)
= "1.11" # For pattern matching
🎯 Roadmap
- Smart dependency checking
- Update categorization (patch/minor/major)
- Interactive dependency updates
- Beautiful terminal output
- Conflict resolution
- Security vulnerability scanning (RustSec integration)
- Unused dependency detection
- CI/CD integration (GitHub Actions)
- Configuration file support
- Workspace support
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📝 License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.
🙏 Acknowledgments
Built with:
- clap - Command line argument parsing
- reqwest - HTTP client
- semver - Semantic version parsing
- colored - Terminal colors
- indicatif - Progress bars
- dialoguer - Interactive prompts
Made with ❤️ by Rust developers, for Rust developers.
Stop fighting with dependencies. Stay sane. 🧠