Txt file with all the crates @ crates.io?

Is there a way to get a txt file with all the crate names of the crates @ crates.io? (If it could include the summary, even better; but just the crate name is enough).

XY problem: I want to run local tools (like grep) to search for crate name.

You can get information about all the crates from GitHub - rust-lang/crates.io-index: Registry index for crates.io

Generate yourself a list of all the file names in this repo (except for the config.json), and you have a file with all the crate names.

If there’s a performance reason that still applies to your intended use-cases for not having it all in a single directory or a single file, you might want to skip the conversion and set up your local tools in a way to work with the directory structure as-is.

Edit: You could even consider directly reading the existing index on your computer at ~/.cargo/registry/index/github.com-…/….


This worked; thanks! For anyone curious, turns out the whole thing is only ~1.3 G; and on a SSD, running simple greps seem to be < 1s.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.