#cargo-version #cargo-cli #cli #latest #cargo-latest

app cargo-latest-version

A small cli that returns the latest version of a rust crate

1 unstable release

Uses new Rust 2024

0.1.0 Nov 13, 2025

#1759 in Command line utilities

Apache-2.0

20KB
239 lines

cargo-latest

A small cli that returns the latest version of a rust crate.

How To Use

Usage: cargo latest [OPTIONS] <NAME>

Arguments:
  • <NAME> — The name of the target crate
Options:
  • --minor — Returns only the minor portion of the version (e.g. "1.0.0" => "1.0")
  • --major — Returns only the major portion of the version (e.g. "1.0.0" => "1")
  • --exact — Whether the version should be exact (e.g. "=1.0.0")
  • -p, --pure — Returns the pure crate version, without the crate name. Incompatible with --optional, --features and --no-default
  • -o, --optional — Adds optional = true to the output (e.g. serde = { version = "1.0", optional = true }). Incompatible with --pure
  • -f, --features <FEATURES> — Adds a list of features to the output (e.g. serde = { version = "1.0", features = ["derive"] }). Incompatible with --pure
  • --no-default — Adds default-features = false the output (e.g. serde = { version = "1.0", default-features = false }). Incompatible with --pure

Clipboard Integration

You can combine this command with your os-specific clipboard tools to directly copy the output value to the clipboard.

Example in bash:

cargo latest --major serde | xclip -selection clipboard

You can then create a function to make the command even easier:

cargo-latest() {
  cargo latest "$@" | xclip -selection clipboard
}
cargo-latest --major serde

Dependencies

~8–20MB
~347K SLoC