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
16KB
142 lines
๐ Cargo-Sleek
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
andCargo.lock
for unused dependencies. - ๐ Build Performance Analysis โ Measures build times and saves detailed performance reports.
- ๐งน Direct Cargo Execution โ Enables quick execution of
cargo build
andcargo 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