cargo-pkgid
Print a fully qualified package specification
TLDR
Show package ID for current package
SYNOPSIS
cargo pkgid [options] [spec]
DESCRIPTION
cargo pkgid prints the fully qualified package ID specification for a package in the dependency graph. The output includes the source URL, package name, and version in a canonical format that can be used with other Cargo commands like `cargo update -p`.
This command is primarily useful when multiple versions of the same package exist in the dependency tree and disambiguation is needed. It accepts partial specifications such as just the name or name with version, and resolves them against the lockfile. The Cargo.lock file must exist and dependencies must be fetched before this command can be used.
PARAMETERS
-p, --package spec
Package to query--manifest-path path
Path to Cargo.toml-v, --verbose
Verbose output-q, --quiet
Suppress output
SPEC FORMATS
name
regexname@version
regex@1.4.3url#name
https://github.com/rust-lang/crates.io-index#foourl#name@version
https://github.com/rust-lang/cargo#crates-io@0.21.0
FULL SPEC FORMAT
CAVEATS
Errors if specification is ambiguous. Add version qualifier to disambiguate multiple versions. Requires lockfile and fetched dependencies.
SEE ALSO
cargo(1), cargo-metadata(1)
