# 使用 Homebrew, Nix, pacman 安装 cargo-depgraph

查看 cargo-depgraph 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

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

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install cargo-depgraph
```

  证据: local Homebrew formula metadata

### Linux

- Nix (92%):

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

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

- pacman (92%):

```sh
sudo pacman -S cargo-depgraph
```

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

## 软件包事实

- **软件包键:** brew:cargo-depgraph
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/cargo-depgraph>
- **版本:** 1.6.0
- **来源摘要:** Creates dependency graphs for cargo projects
- **主页:** <https://sr.ht/~jplatte/cargo-depgraph/>
- **上游文档:** <https://sr.ht/~jplatte/cargo-depgraph/>
- **许可证:** GPL-3.0-or-later
- **源码归档:** <https://git.sr.ht/~jplatte/cargo-depgraph/archive/v1.6.0.tar.gz>
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- cargo-depgraph (cli)
- cargo-depgraph (别名)

## 构建依赖

- rust

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_monterey, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, monterey, sonoma, ventura, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 1.6.0
- 本地数据: OK
- 上游仓库: https://sr.ht/~jplatte/cargo-depgraph/
- 信息: No package-manager update timestamp was available.
- 信息: Release/tag comparison is only available for GitHub repositories.
## 项目历史与用法

cargo-depgraph is a Cargo subcommand for turning a Rust package's Cargo metadata into Graphviz dependency graphs. It fills the small but durable need to see feature, target, dev, build, optional, and transitive dependency structure as an image or DOT graph.

### 项目历史

The crate was published on crates.io in July 2020 with the description that it creates dependency graphs for Cargo projects using cargo metadata and Graphviz. Its official repository metadata has since appeared under jplatte's Codeberg account, while crates.io still records the older SourceHut repository URL, suggesting a repository-hosting move rather than a change in purpose.

The README's examples focus on piping `cargo depgraph` into Graphviz's `dot`, and the documented output legend shows the project grew around Cargo-specific semantics rather than generic graph rendering.

### 采用历史

Adoption is niche but broad enough for distribution packaging: the supplied package-manager facts list Homebrew, Nix, and Arch Linux packages, and crates.io records tens of thousands of downloads. That puts cargo-depgraph in the class of Rust ecosystem utilities that are not core workflow tools, but are useful enough to be packaged by Unix-oriented distributions.

### 使用方式

Users run `cargo depgraph [options] | dot -Tpng > graph.png` from a Cargo project, with Graphviz installed locally or another DOT renderer available. Common options include `--all-deps` and `--all-deps --dedup-transitive-deps` for fuller dependency views.

### 为什么软件包爱好者会关心

Package nerds care about cargo-depgraph because it exposes Cargo resolver state visually: optional dependencies, target-specific dependencies, build dependencies, dev dependencies, and transitive optional edges become inspectable without hand-reading `Cargo.lock` and `Cargo.toml` trees.

It is also a good example of the Rust community's habit of building small Cargo subcommands around `cargo metadata`, then letting traditional Unix tools such as Graphviz handle the final representation.

### 时间线

- 2020: cargo-depgraph crate first published on crates.io.
- 2023: crates.io metadata for cargo-depgraph last updated at version 1.6.0.
- 2026: Codeberg repository metadata lists jplatte/cargo-depgraph as an active repository.

### Related projects

- Cargo metadata is the data source that lets cargo-depgraph inspect Rust package graphs.
- Graphviz is the rendering toolchain used by the README examples.
- Other Cargo inspection tools, such as cargo tree, overlap in dependency exploration but present the graph as text rather than DOT output.

### 来源

- <https://codeberg.org/api/v1/repos/jplatte/cargo-depgraph>
- <https://codeberg.org/jplatte/cargo-depgraph#readme>
- <https://crates.io/api/v1/crates/cargo-depgraph>
- input.source_facts.package-manager


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 源数据库详情

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

## 其他软件包管理器记录

- Nix - cargo-depgraph: normalized package name match | nixpkgs package indexes: pkgs/by-name/ca/cargo-depgraph/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- pacman - cargo-depgraph - 1.6.0-3: normalized package name match | Arch Linux sync databases: cargo-depgraph from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Creates dependency graphs for cargo projects using cargo metadata and graphviz | https://github.com/jplatte/cargo-depgraph


## 相关链接

- [Package publisher tools](https://pkg.so/zh-hans/package-publishers/) - Belongs to a package publishing or registry command family.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://pkg.so/zh-hans/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://pkg.so/zh-hans/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [rust](https://pkg.so/zh-hans/brew/rust/) - Build dependency declared by Homebrew.
- [cargo-binstall](https://pkg.so/zh-hans/brew/cargo-binstall/) - Shares pkgdb curated category or tags: cargo, cli, developer-tools, rust.
- [cargo-c](https://pkg.so/zh-hans/brew/cargo-c/) - Shares pkgdb curated category or tags: cargo, cli, developer-tools, rust.
- [cargo-nextest](https://pkg.so/zh-hans/brew/cargo-nextest/) - Shares pkgdb curated category or tags: cargo, cli, developer-tools, rust.
- [cargo-edit](https://pkg.so/zh-hans/brew/cargo-edit/) - Shares pkgdb curated category or tags: cargo, cli, developer-tools, rust.
- [cargo-update](https://pkg.so/zh-hans/brew/cargo-update/) - Shares pkgdb curated category or tags: cargo, cli, developer-tools, rust.
- [cargo-llvm-cov](https://pkg.so/zh-hans/brew/cargo-llvm-cov/) - Shares pkgdb curated category or tags: cargo, cli, developer-tools, rust.
- [cargo-udeps](https://pkg.so/zh-hans/brew/cargo-udeps/) - Shares pkgdb curated category or tags: cargo, cli, developer-tools, rust.
- [cargo-outdated](https://pkg.so/zh-hans/brew/cargo-outdated/) - Shares pkgdb curated category or tags: cargo, cli, developer-tools, rust.
- [cargo-features-manager](https://pkg.so/zh-hans/brew/cargo-features-manager/) - Both packages touch the same language runtime or ecosystem. Shared terms: cargo, cli, dependency, developer, developer-tools.

## Combined YAML source

View the package source record on GitHub. [combined/cargo-depgraph.yml](https://github.com/mxcl/pkgdb/blob/main/combined/cargo-depgraph.yml)


## 来源

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