#tracking #cargo #cargo-cli #cli #rust

app cargo-sleek

๐Ÿš€ A sleek CLI tool to track and optimize Cargo commands

2 releases (1 stable)

new 1.1.0 Mar 29, 2025
0.1.0 Mar 28, 2025

#35 in #cargo-cli

35 downloads per month

MIT/Apache

16KB
142 lines

๐Ÿš€ Cargo-Sleek

License
Rust Version
Build Status

Cargo-Sleek is a lightweight, intelligent Cargo command tracking and optimization tool that enhances the Rust development experience by providing command insights, dependency analysis, and build performance tracking.


๐ŸŽฏ Why Cargo-Sleek?

โœ… Unique Features

  • ๐Ÿ“Š Command Usage Analytics โ€“ Tracks and displays your most frequently used Cargo commands.
  • ๐Ÿ” Unused Dependency Check โ€“ Scans your Cargo.toml and Cargo.lock for unused dependencies.
  • ๐Ÿš€ Build Performance Analysis โ€“ Measures build times and saves detailed performance reports.
  • ๐Ÿงน Direct Cargo Execution โ€“ Enables quick execution of cargo build and cargo clean directly.
  • ๐Ÿ”„ Reset Functionality โ€“ Clear command usage statistics when needed.

๐Ÿ›  Who is this for?

Cargo-Sleek is built for Rust developers who want to:

โœ… Optimize their Cargo workflow by analyzing command usage patterns.  
โœ… Keep their projects clean from unnecessary dependencies.  
โœ… Improve compile times with build performance tracking.  
โœ… Have a single tool to execute and analyze Cargo operations.  

๐Ÿš€ Installation

To install Cargo-Sleek, clone the repository and build it manually:

git clone https://github.com/your-repo/cargo-sleek.git
cd cargo-sleek
cargo build --release

Move the binary to a location in your $PATH for global access:

mv target/release/cargo-sleek /usr/local/bin/

Now, you can use cargo-sleek from anywhere in your terminal.

๐Ÿ“– Usage Guide

๐Ÿ“Š 1. Track Most Used Commands

cargo-sleek stats

Description: Displays a ranked list of your most frequently used Cargo commands.

๐Ÿ”„ 2. Reset Command Usage Statistics

cargo-sleek reset

Description: Clears all tracked Cargo command usage data.

๐Ÿ” 3. Check for Unused Dependencies

cargo-sleek check-deps

Description: Scans Cargo.toml and Cargo.lock to find dependencies that are no longer needed.

โฑ๏ธ 4. Analyze Build Performance

cargo-sleek build-time

Description: Runs cargo build, records build time, and saves a detailed report in build_timings.log.

๐Ÿ”จ 5. Build the Project

cargo-sleek build

Description: Runs cargo build to compile your Rust project.

๐Ÿงน 6. Clean the Project

cargo-sleek clean

Description: Runs cargo clean to remove the target directory and free up space.

๐Ÿ›  How it Works

Cargo-Sleek wraps around the Cargo command-line tool and tracks executed commands. It stores command statistics in command_stats.json and provides insights through JSON parsing, execution tracking, and build performance analysis.

Core Working Modules
Command Tracking โ€“ Logs how often each Cargo command is used.
Dependency Analysis โ€“ Reads Cargo.toml and Cargo.lock to find unused dependencies.
Build Timing Analysis โ€“ Measures cargo build execution time and stores logs.
๐Ÿ”‘ Dual Licensing: Apache-2.0 & MIT

Cargo-Sleek is licensed under a dual Apache-2.0 and MIT license, allowing users and contributors maximum flexibility.

What This Means for You
You can use, modify, and distribute this software under either the Apache-2.0 OR MIT license.
You are free to use Cargo-Sleek in both open-source and commercial projects.
If you modify and distribute the project, attribution is required.
For more details, check out:

Apache License 2.0 MIT License ๐Ÿ‘จโ€๐Ÿ’ป Contributing

We welcome contributions to Cargo-Sleek! To get started:

Fork the repository

Create a new branch

git checkout -b feature-your-feature-name

Make your changes and commit

git commit -m "Added new feature"
Push to your branch

git push origin feature-your-feature-name

Create a Pull Request on GitHub.

Contribution Guidelines

โœ… Keep code clean and well-documented.
โœ… Follow Rust best practices and formatting (cargo fmt).
โœ… Test your changes before submitting (cargo test).

๐Ÿ“ Future Improvements

๐Ÿ”ง Customizable configuration file for tracking preferences.
๐Ÿ“Š More in-depth performance insights on Cargo builds.
๐Ÿš€ Support for benchmarking and cache optimization.
๐Ÿ”„ Add automatic dependency removal for unused dependencies.
๐Ÿ“œ License

This project is dual-licensed under both Apache-2.0 and MIT, giving you the flexibility to choose the license that works best for your project.


๐Ÿ’ฌ Feedback & Support

Weโ€™d love to hear your feedback! If you encounter issues or have feature suggestions:

Submit an issue on GitHub.
Join discussions in the community forums.
โญ Enjoy using Cargo-Sleek?
Give the project a star โญ on GitHub and help spread the word!

๐Ÿš€ Happy Coding with Rust! ๐Ÿฆ€

Dependencies

~3โ€“10MB
~104K SLoC