# Install cargo-cache with Homebrew, Nix, pacman

Display information on the cargo cache, plus optional cache pruning. Version 0.8.3 via Homebrew; verified from local package data.

## Install

```sh
sudo av install brew:cargo-cache
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install cargo-cache
```

  Evidence: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#cargo-cache
```

  Evidence: nixpkgs package indexes: pkgs/by-name/ca/cargo-cache/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S cargo-cache
```

  Evidence: Arch Linux sync databases: cargo-cache from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

## Package facts

- **Package key:** brew:cargo-cache
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/cargo-cache>
- **Version:** 0.8.3
- **Source summary:** Display information on the cargo cache, plus optional cache pruning
- **Homepage:** <https://github.com/matthiaskrgr/cargo-cache>
- **Repository:** <https://github.com/matthiaskrgr/cargo-cache>
- **Upstream docs:** <https://github.com/matthiaskrgr/cargo-cache#readme>
- **License:** Apache-2.0 OR MIT
- **Source archive:** <https://github.com/matthiaskrgr/cargo-cache/archive/refs/tags/0.8.3.tar.gz>
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- cargo-cache (cli)
- cargo-cache (alias)

## Build dependencies

- rust

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 0.8.3
- Local data: ok
- Upstream repository: https://github.com/matthiaskrgr/cargo-cache
- Upstream latest detected: 0.8.3 (current)
- info: No package-manager update timestamp was available.
## Project history and usage

cargo-cache is a Cargo subcommand for inspecting and pruning the Cargo home cache, including registry archives, extracted sources, git checkouts, installed binaries, toolchains, local target caches, and sccache summaries.

### Project history

The cargo-cache repository was created in December 2017, and the first crates.io release followed in October 2018. The README describes it as a tool for displaying information about `~/.cargo/` or `$CARGO_HOME`, with optional cache pruning.

The project began as the maintainer's learning-by-doing Rust project, according to the README, but accumulated a practical feature set: size summaries, autoclean, dry-run removals, git repository garbage collection, regex cache queries, largest-item reports, alternative registry support, age-based removal, unreferenced-cache cleanup, sccache stats, and verification of extracted crate sources.

### Adoption history

cargo-cache gained adoption because Cargo caches can become large on developer machines and CI systems. The README explicitly discusses CI cleanup before storing `$CARGO_HOME`, and crates.io reports more than 3 million downloads.

The input records Homebrew, Nix, and Arch packaging. Its high download count for a maintenance tool reflects a recurring need rather than glamour: package caches grow quietly, and developers want a Cargo-aware cleanup tool before deleting directories by hand.

### How it is used

`cargo cache` prints a size breakdown without deleting anything. `cargo cache --autoclean` removes extracted crate sources and git checkouts while keeping original archives and bare repositories so Cargo can reconstruct them as needed.

Other documented workflows include `--top-cache-items` for largest entries, `--dry-run` before removals, `cargo cache query` for regex searches, `cargo cache clean-unref` for cache entries not referenced by a Cargo.toml, `cargo cache sc` for local sccache stats, and `cargo cache verify` for extracted crate sources.

### Why package nerds care

cargo-cache is package-nerd plumbing: it exposes the physical layout and cost of Cargo's package cache. That makes it useful for people who care about how registries, source archives, git checkouts, installed binaries, and CI caches accumulate over time.

It also documents a conservative cleanup philosophy. The default inspection mode is read-only, and autoclean keeps reconstructable originals, matching the practical rule that cache tools should save disk without surprising the package manager.

### Timeline

- 2017-12-05: GitHub repository matthiaskrgr/cargo-cache was created.
- 2018-10-17: cargo-cache 0.0.0 was published on crates.io.
- 2022-09-11: Version 0.8.3 was published.
- 2020s: README documented CI cleanup, sccache summaries, alternative registries, verification, and unreferenced-cache cleanup.

### Related projects

- Cargo's `$CARGO_HOME` cache layout is the main system cargo-cache inspects.
- sccache is related only as a cache that cargo-cache can summarize; the README says cargo-cache is not itself a compiler cache.
- Cargo registry archives, registry source checkouts, git databases, and git checkouts are the package-manager structures exposed by the tool.

### Sources

- GitHub repository API metadata: https://api.github.com/repos/matthiaskrgr/cargo-cache
- Official README: https://github.com/matthiaskrgr/cargo-cache#readme
- Package-manager adoption from source_facts.package-manager.
- crates.io API metadata and versions: https://crates.io/api/v1/crates/cargo-cache


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** cargo-cache
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Nix - cargo-cache: normalized package name match | nixpkgs package indexes: pkgs/by-name/ca/cargo-cache/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- pacman - cargo-cache - 0.8.3-4: normalized package name match | Arch Linux sync databases: cargo-cache from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Display info and prune cargo cache | https://github.com/matthiaskrgr/cargo-cache


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Package publisher tools](https://www.automicvault.com/pkg/package-publishers/) - Belongs to a package publishing or registry command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [rust](https://www.automicvault.com/pkg/brew/rust/) - Build dependency declared by Homebrew.
- [cargo-auditable](https://www.automicvault.com/pkg/brew/cargo-auditable/) - Shares av.db curated category or tags: cargo, cli, developer-tools, rust.
- [cargo-binstall](https://www.automicvault.com/pkg/brew/cargo-binstall/) - Shares av.db curated category or tags: cargo, cli, developer-tools, rust.
- [cargo-binutils](https://www.automicvault.com/pkg/brew/cargo-binutils/) - Shares av.db curated category or tags: cargo, cli, developer-tools, rust.
- [cargo-bloat](https://www.automicvault.com/pkg/brew/cargo-bloat/) - Shares av.db curated category or tags: cargo, cli, developer-tools, rust.
- [cargo-bundle](https://www.automicvault.com/pkg/brew/cargo-bundle/) - Shares av.db curated category or tags: cargo, cli, developer-tools, rust.
- [cargo-c](https://www.automicvault.com/pkg/brew/cargo-c/) - Shares av.db curated category or tags: cargo, cli, developer-tools, rust.
- [cargo-careful](https://www.automicvault.com/pkg/brew/cargo-careful/) - Shares av.db curated category or tags: cargo, cli, developer-tools, rust.
- [cargo-chef](https://www.automicvault.com/pkg/brew/cargo-chef/) - Shares av.db curated category or tags: cargo, cli, developer-tools, rust.
- [cargo-cache](https://www.automicvault.com/pkg/cargo/cargo-cache/) - Same normalized package name exists in another local package ecosystem.

## Combined YAML source

View the package source record on GitHub. [combined/cargo-cache.yml](https://github.com/automic-vault/db/blob/main/combined/cargo-cache.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
