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.
- π 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
cargo install cargo-saneOr build from source:
git clone https://github.com/ChronoCoders/cargo-sane
cd cargo-sane
cargo install --path .Analyze your dependencies and see what's available:
cargo sane checkExample 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 interactively:
cargo sane updateThis 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:
cargo sane update --allDry run (preview without changing):
cargo sane update --dry-runGet detailed information about updates:
cargo sane check --verboseWork with a specific manifest:
cargo sane check --manifest-path /path/to/Cargo.toml
cargo sane update --manifest-path /path/to/Cargo.toml| 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 |
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
- 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
cargo-sane handles all dependency formats:
# Simple
serde = "1.0"
# With features
tokio = { version = "1.35", features = ["full"] }
# Optional dependencies
clap = { version = "4.5", optional = true }
# With comments (preserved!)
regex = "1.11" # For pattern matching- 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
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
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.
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. π§