Open-source project
cargo-bins/cargo-binstall avatar
cargo-bins/cargo-binstall

cargo-binstall: installing Rust binaries without compiling them

Binary installation for rust projects

2,892 stars116 forksRustGPL-3.0

At a glance

What is it?
cargo-binstall is a drop-in replacement for cargo install that downloads prebuilt Rust binaries when it can find them. It is a good fit for CI and for machines that should not spend ten minutes compiling a CLI tool.
Who is it for?
Adopt cargo-binstall if you install Rust CLI tools often, especially in CI or on machines where a compile is expensive. Do not adopt it if you need every tool built against your own toolchain flags, or if you require signature verification and the crates you use have no signing metadata.
Can I use it commercially?
Yes, with conditions. GPL-3.0 is a copyleft licence: if you distribute software that includes it, you must release that software's source code under the same licence. Running it internally without distributing it does not trigger that obligation.
Is it still maintained?
Yes. The repository last received commits 8 days ago.
What is it written in?
Mainly Rust, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 24, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The problem cargo-binstall solves, and who it is for

cargo install compiles a crate from source on your machine. For a small CLI tool that is a few seconds. For a tool with a large dependency tree it can be minutes, and in a CI job that runs on every pull request those minutes repeat. cargo-binstall exists to skip that compile when someone has already published a matching binary.

The intended audience is narrow and clear. It is people who install Rust binaries as tools rather than as libraries: developers who want a formatter or a linter available on their laptop, and CI pipelines that need the same tool on every run. The README describes it as a drop-in replacement for cargo install in many cases, and it accepts similar options. Package maintainers are a second audience, but only if they choose to act. The README notes that maintainers can add explicit Binstall metadata to Cargo.toml to help locate the right binary package for a version and target, and that this is optional.

How resolution works: crates.io, the repository, quickinstall, cargo install

The mechanism is a search with a fallback chain, and the order matters. Binstall first fetches crate information from crates.io. It then looks at the repository link recorded for that crate and searches the linked repository for matching releases and artifacts. If that turns up nothing usable, it falls back to quickinstall, a third-party artifact host. It can also fall back to alternate targets where supported. Only after all of that fails does it run cargo install.

That chain explains the failure modes you should expect. If a crate publishes GitHub releases with names Binstall cannot match, resolution drops a level. If quickinstall has never built the crate for your target, it drops again. The last level always works, because it is the compiler, but it is also the slow path the tool was meant to avoid.

The repository layout reflects this split into stages. The workspace lists separate crates for the registry, manifests, fetchers, downloader, and a git repo API, plus detect-targets and detect-wasi. That is a lot of small crates for one tool, which suggests the project treats target detection and artifact fetching as independently testable problems.

When auto-detection fails, the README says you can specify pkg-url, bin-dir, and pkg-fmt yourself on the command line, with values documented in SUPPORT.md. That is the escape hatch for packages whose release naming does not fit the conventions.

Installing cargo-binstall and doing a first install with it

The quickest route on Linux and macOS is the install script published in the repository. It downloads a prebuilt cargo-binstall binary.

bash
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash

On macOS with Homebrew installed, the README gives a shorter path.

bash
brew install cargo-binstall

On Windows, the README uses a PowerShell one-liner that sets the execution policy for the current process only.

bash
Set-ExecutionPolicy Unrestricted -Scope Process; iex (iwr "https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.ps1").Content

If you prefer to build it once from source, the README gives the locked cargo install form.

bash
cargo install cargo-binstall --locked

Once installed, the basic use is a subcommand. The README shows this example, which resolves a specific version and prints where the binary came from before asking for confirmation.

bash
cargo binstall [email protected]

In that example the output warns that the package was downloaded from github.com, lists the binary it will install and the destination path, and then asks whether to continue. For unattended use such as CI, the README says to pass --no-confirm. Upgrading Binstall itself is the same command pointed at its own name, which the README writes as cargo binstall cargo-binstall.

In GitHub Actions the project ships a first-party minimal action. The README shows it with an optional version input that defaults to latest.

yaml
  - uses: cargo-bins/cargo-binstall@main
    with:
      version: "1.2.3" # optional; defaults to latest

Signature checking is partial, and that is the main caveat

The README is direct about this: signature support is described as initial and limited. Maintainers can specify a signing public key and where to find package signatures, and when that metadata exists Binstall downloads and verifies signatures for that package. The word to notice is that: for that package. A crate with no signing metadata is not covered by this mechanism.

There are two flags that change the behaviour, and they pull in opposite directions. --only-signed refuses to install packages that are not signed, which is the strict setting. --skip-signatures disables checking and downloading signatures entirely, and the README explicitly advises against using it outside testing.

So the honest reading is that Binstall does not give you a uniform verification story across the ecosystem. It gives you verification where maintainers opted in. If your policy requires every installed binary to be signature-verified, cargo-binstall cannot currently guarantee that for arbitrary crates, and --only-signed will simply refuse the ones without metadata. That is a real limitation, not a configuration detail.

The second caveat is trust in the source. Resolution can end at a linked repository or at quickinstall, a third-party host. The README's own example prints a warning line when a package comes from github.com, which tells you the tool wants you to notice where the bytes came from.

Where cargo-binstall is the wrong tool

If you are installing a library rather than a tool, this is not the right command. Binstall installs binaries into a bin directory; it does not add a dependency to your project. Use cargo add for that.

If you need the binary compiled with your own feature flags, a specific target, or a patch applied to a dependency, a downloaded artifact cannot help you. The prebuilt binary was built by someone else with their choices. The README's fallback to cargo install exists precisely for the cases where no artifact fits, but if you always need custom flags you will always land on that fallback and pay for the resolution attempt first.

There is also a project-scoping mismatch. The README notes that Binstall and cargo install both install tools globally by default, which is fine for system-wide tools. If you want tool versions pinned per project and recorded in Cargo.toml, the README points at cargo-run-bin as the tool for that job, and says cargo-run-bin will use Binstall when it is available.

Finally, if your environment cannot reach crates.io, GitHub, or the quickinstall host, the resolution chain has nothing to work with.

The alternative: plain cargo install, and when it wins

The direct alternative is cargo install, which Binstall treats as its own last resort. The difference is not in the interface, where Binstall aims to be compatible, but in what happens on disk and in time. cargo install always compiles from the crate source with your local toolchain; Binstall tries to avoid that by downloading an artifact someone else built.

That difference cuts both ways. Compiling from source is slower but it is uniform: the same command produces a binary built against your toolchain, your target, and your feature selection. Downloading an artifact is fast but depends on a third party having built exactly the right thing for your platform. When a crate has no published artifacts, cargo install is not a fallback for Binstall, it is simply the only option, and running Binstall first just adds a resolution attempt that fails.

For a one-off install on a fast machine, compiling is often fine and you skip the whole question of artifact provenance. For repeated installs across many CI runs, or on a laptop where a compile competes with actual work, the trade flips. The README's own framing of the problem is that wget-ing releases is frustrating while cargo install takes a not inconsequential amount of time; Binstall sits between those two.

Maintenance, licence, and what the repository tells you

The repository is not archived, and the last push was on 2026-09-23, days before this writing. Recent releases include v1.23.0 on 2026-09-05, alongside versioned releases of companion crates detect-targets and binstalk on the same day. That release pattern, where internal crates are versioned and published separately, is consistent with the workspace layout in Cargo.toml, which lists fifteen member crates.

The licence is GPL-3.0. For a command-line tool you invoke as a separate process, that is a different situation from linking a library into your own code, but the distinction is a legal question and not one this article can settle. If you plan to embed Binstall's crates such as binstalk in your own product, read the licence text and take advice rather than relying on a summary.

Upgrade cost is low by design. The README's own upgrade instruction is cargo binstall cargo-binstall, which is the same resolution path applied to itself, and the GitHub Action takes an optional version input. There is no migration step documented, and the README does not describe rollback. The release-plz.toml and rust-toolchain.toml files at the repository root indicate automated release tooling and a pinned toolchain, so build reproducibility is at least a stated concern of the project.

Editorial conclusion

Adopt cargo-binstall if you install Rust CLI tools often, especially in CI or on machines where a compile is expensive. Do not adopt it if you need every tool built against your own toolchain flags, or if you require signature verification and the crates you use have no signing metadata. Before rolling it out, check that the crates you care about actually publish matching release artifacts, and try one install with --no-confirm in a scratch container to see which source it resolves to.

Frequently asked questions

What is the purpose of cargo-binstall?

It installs Rust binaries as an alternative to building from source with cargo install or downloading packages manually. It resolves a crate from crates.io, searches the linked repository for matching release artifacts, falls back to quickinstall, and finally to cargo install.

How do I install cargo-binstall?

The README gives one-liners for Linux and macOS, a Homebrew formula, a PowerShell one-liner for Windows, and cargo install cargo-binstall --locked from source. Prebuilt archives for specific targets are also listed for manual download into $HOME/.cargo/bin.

Is cargo-binstall safe?

The README describes signature support as initial and limited: maintainers can specify a signing key and where to find package signatures, and Binstall verifies those. Crates without signing metadata are not covered, and --only-signed refuses to install packages that are not signed.

What is a binary installation in cargo-binstall?

It means installing a prebuilt executable rather than compiling the crate. Binstall fetches crate information from crates.io, looks for matching release artifacts in the linked repository, and falls back to quickinstall or to cargo install when no artifact matches.

What is cargo binstall?

It is a cargo subcommand from the cargo-bins/cargo-binstall project that installs Rust binaries from prebuilt artifacts where available, rather than compiling them. The README describes it as a low-complexity mechanism for installing Rust binaries as an alternative to cargo install or manual downloads.

Official sources

  1. cargo-bins/cargo-binstall on GitHub
  2. Issues
  3. License: GPL-3.0
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/cargo-bins-cargo-binstall.svg)](https://hysenlabs.com/projects/cargo-bins-cargo-binstall)