cargo-sane

Crates.iocargo-sane
lib.rscargo-sane
version0.2.0
created_at2025-10-26 02:21:38.921645+00
updated_at2025-10-26 02:21:38.921645+00
descriptionStop losing your mind over Rust dependency conflicts
homepagehttps://github.com/chronocoders/cargo-sane
repositoryhttps://github.com/chronocoders/cargo-sane
max_upload_size
id1900880
size98,936
Altug Tatlisu (ChronoCoders)

documentation

https://docs.rs/cargo-sane

README

🧠 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.

Crates.io License

✨ Features

  • 🔍 Smart Dependency Analysis - Scans your Cargo.toml and 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

cargo install cargo-sane

Or build from source:

git clone https://github.com/ChronoCoders/cargo-sane
cd cargo-sane
cargo install --path .

🚀 Usage

Check for Updates

Analyze your dependencies and see what's available:

cargo sane check

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:

cargo sane update

This will:

  1. Show you all available updates
  2. Let you select which ones to apply (spacebar to select, enter to confirm)
  3. Update your Cargo.toml (with automatic backup)
  4. Preserve all formatting, comments, and features

Update all dependencies automatically:

cargo sane update --all

Dry run (preview without changing):

cargo sane update --dry-run

Verbose Mode

Get detailed information about updates:

cargo sane check --verbose

Specify Cargo.toml Path

Work with a specific manifest:

cargo sane check --manifest-path /path/to/Cargo.toml
cargo sane update --manifest-path /path/to/Cargo.toml

📋 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.backup before 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
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

🎯 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.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📝 License

Licensed under either of:

at your option.

🙏 Acknowledgments

Built with:


Made with ❤️ by Rust developers, for Rust developers.

Stop fighting with dependencies. Stay sane. 🧠

Commit count: 0

cargo fmt