Introduction
The ratcrate-cli Project
ratcrate is a highly efficient command-line interface (CLI) application written in Rust designed to be the primary tool for discovering, searching, and managing packages within the rapidly growing Ratatui (Terminal User Interface) ecosystem.
The project’s goal is to provide developers with instant, terminal-native access to up-to-date crate information, bypassing the need to browse websites.
Key Features
- Offline Access: Intelligent caching ensures that data is only downloaded when stale (older than 1 day) or when a manual refresh is requested.
- Fuzzy Search: Filter crates by name or description using the
-q, --queryargument. - Interactive Selection: Integrates seamlessly with the external
fzfutility for interactive, searchable selection (-f). - Statistical Breakdown: Provides a clear summary of total, core, and community crates (
-t). - Configurable Display: Supports both a default colorful list view and an optional structured table view.
Getting Started and Usage
Prerequisites
To build and run ratcrate, you must have the following installed:
- Rust Toolchain: Install Rust and Cargo via rustup.
- fzf (Optional): The fuzzy finder utility is required to use the interactive selection mode (
-f). Install it via your operating system’s package manager (e.g.,sudo apt install fzforbrew install fzf).
Building and Running
Clone the repository (or ensure the files are in one directory) and use Cargo to build and run the application.
```bash # Build and run the executable cargo run –release
Run with a standard query
cargo run – -q “widgets”
| Flag | Long | Type | Description |
|---|---|---|---|
none |
none |
none |
Show top 10 crates |
-q |
--query |
String | Search term to filter crates by name or description. |
-t |
--total |
none |
Show total count incld. Core vs. Community |
-l |
--limit |
usize |
Maximum number of results to display (default: 10). |
-r |
--refresh |
none |
Force re-download of remote data, bypassing the cache check. |
-c |
--cache-info |
none |
Display the cache directory and file path |
-f |
--fzf |
none |
Use fzf for interactive selection of a crate. |
| none | --table |
none |
Use the table view (requires compiling with the table feature). |