30 releases
Uses new Rust 2024
| 0.1.30 | Mar 28, 2026 |
|---|---|
| 0.1.28 | Feb 13, 2026 |
| 0.1.27 | Nov 28, 2025 |
| 0.1.23 | Jul 28, 2025 |
| 0.1.3 | Dec 28, 2024 |
#2047 in Parser implementations
637 downloads per month
Used in pcu
83KB
2K
SLoC
kdeets
A utility to query crates.io for information about a crate.
Feature set
- Versions for a crate
- Rust versions for dependencies
- Setup limited clone for testing
Installation
Install the CLI using cargo install.
cargo install kdeets
Check program is available and the version installed.
$ kdeets --version
kdeets 0.1.30
Usage
The available commands can be seen by running the command with the help flag.
$ kdeets --help
Query crates.io for information about a crate.
Usage: kdeets [OPTIONS] <COMMAND>
Commands:
crate Query crates.io for information about a crate
rust Query crates.io for maximum Rust version for a crate
setup Setup local registry for a crate
help Print this message or the help of the given subcommand(s)
Options:
-v, --verbose... Increase logging verbosity
-q, --quiet... Decrease logging verbosity
-h, --help Print help
-V, --version Print version
Versions for a crate (cmd: crate)
Display the key versions for the crate.
$ kdeets crate -h
Query crates.io for information about a crate
Usage: kdeets crate [OPTIONS] <CRATE>
Arguments:
<CRATE> The name of the crate
Options:
-v, --verbose... More output per occurrence
-q, --quiet... Less output per occurrence
-b, --bare Display bare version number without text for recent, highest normal, higest or earliest version
-e, --earliest First version ever published. May be yanked
-n, --normal Returns crate version with the highest version number according to semver, but excludes pre-release and yanked versions
-t, --top The highest version as per semantic versioning specification
-r, --recent The last release by date, even if it’s yanked or less than highest version
-l, --list List all versions of the crate
-k, --key List key values (equivalent to `-entr`)
-a, --all List all versions and key values (equivalent to `-entrl`)
-h, --help Print help
-V, --version Print version
This command queries crates.io for information about a crate and reports based on the options selected.
Crates.io tracks for each crate the following versions:
earliest: The first version ever published. May be yanked.normal: Returns crate version with the highest version number according to semver, but excludes pre-release and yanked versions.top: The highest version as per semantic versioning specification.recent: The last release by date, even if it’s yanked or less than highest version.
The key option lists all of these versions (equivalent to -entr).
The command can create a table listing the yank status and version for all versions of the crate.
The all option lists all versions and key values (equivalent to -entrl).
$ kdeets --no-colour crate -entrl some_crate
Crate versions for some_crate.
🭶🭶🭶🭶🭶🭶🭶🭶🭶🭶🭶🭶🭶🭶🭶🭶🭶🭶🭶🭶🭶🭶🭶🭶🭶🭶🭶🭶🭶🭶
Earliest version: 0.1.0
Highest normal version: 0.2.1
Highest version: 0.2.1
Most recent version: 0.2.1
Yanked Version
No 0.1.0
No 0.1.1
No 0.1.3
No 0.2.1
Library API
kdeets also exposes a public Rust library (kdeets_lib) for use in other crates. The library provides two free functions that query the crates.io sparse index directly, without spawning a subprocess.
Add kdeets as a dependency in your Cargo.toml:
[dependencies]
kdeets = "0.1.29"
Check whether a specific version exists
use kdeets_lib::{version_exists, Error};
fn main() -> Result<(), Error> {
if version_exists("serde", "1.0.0")? {
println!("serde 1.0.0 is published");
}
Ok(())
}
version_exists returns:
Ok(true)— the crate and version exist in the indexOk(false)— the crate exists but that version does notErr(Error::CrateNotFoundOnIndex)— the crate is not in the index at all
List all published versions
use kdeets_lib::{list_versions, Error};
fn main() -> Result<(), Error> {
let versions = list_versions("serde")?;
for v in &versions {
println!("{v}");
}
Ok(())
}
list_versions returns all version strings in the order they appear in the index. It returns Err(Error::CrateNotFoundOnIndex) when the crate does not exist.
License
Licensed under the MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT).
Dependencies
~17–35MB
~532K SLoC