I've installed several CLI tools using cargo install
(for instance, ripgrep). How do I see a list of all the crates I've downloaded using cargo install
? Sort of like apt list --installed
but for cargo
?
The command line
cargo help install
produces detailed help information. Among others, it lists common EXAMPLES, e.g.
View the list of installed packages:
cargo install --list
This lists all installed packages alongside their versions and the collection of binaries contained. Doing this is superior to other proposed solutions as packages can contain multiple binaries (e.g. cargo-edit
) or have a binary name that doesn't match the crate name (such as ripgrep
).
Just be careful not to type cargo install list
as that is trying to install the list
package, which thankfully errors out at the time of writing (as opposed to installing a rogue binary).
ls ~/.cargo/bin/
The binary files are stored here, so listing all the files in this directory will give you all the global cargo crates you've installed.
If you want to manipulate the list shown by cargo install --list
, then please check:
cat $CARGO_HOME/.crates.toml
cat $CARGO_HOME/.crates2.json | jq .
Please note that .crates2.json
is in json format.
To list out the installed package names you could run:
cat $CARGO_HOME/.crates2.json | jq -r '.installs | keys[] | split(" ")[0]'
$CARGO_HOME/.crates2.json
(not inside the bin
directory). –
Deficiency A bit late to the party here but I recently needed to install all the packages on one machine on another so I came up with this little sequence
cargo install --list | awk '/^\w/ {print $1}' | tr '\n' ' ' | ssh [yourremote] "xargs cargo install"
If you just need the package names
cargo install --list | awk '/^\w/ {print $1}'
will get you just the package names.
© 2022 - 2025 — McMap. All rights reserved.
cargo install cargo-edit
gives youcargo-add
andcargo-rm
. – Deficiency