Skip to content

Stop losing your mind over Rust dependency conflicts. Smart dependency management for Cargo projects.

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

ChronoCoders/cargo-sane

Repository files navigation

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

About

Stop losing your mind over Rust dependency conflicts. Smart dependency management for Cargo projects.

Topics

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE-APACHE
MIT
LICENSE-MIT

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages