# 使用 Homebrew, apk, Nix, pacman 安装 cargo-sort

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

## 安装

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

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install cargo-sort
```

  证据: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add cargo-sort
```

  证据: Alpine Linux edge package indexes: cargo-sort from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Nix (92%):

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

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

- pacman (92%):

```sh
sudo pacman -S cargo-sort
```

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

## 软件包事实

- **软件包键:** brew:cargo-sort
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/cargo-sort>
- **版本:** 2.1.4
- **来源摘要:** Tool to check that your Cargo.toml dependencies are sorted alphabetically
- **主页:** <https://github.com/devinr528/cargo-sort>
- **仓库:** <https://github.com/devinr528/cargo-sort>
- **许可证:** Apache-2.0 OR MIT
- **源码归档:** <https://github.com/DevinR528/cargo-sort/archive/refs/tags/v2.1.4.tar.gz>
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- cargo-sort (cli)
- cargo-sort (别名)

## 构建依赖

- rust

## 安装行为

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

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 2.1.4
- 本地数据: OK
- 上游仓库: https://github.com/DevinR528/cargo-sort
- 检测到的最新版本: v2.1.4 (当前)
- 信息: No package-manager update timestamp was available.
## 项目历史与用法

cargo-sort is a Rust Cargo subcommand for checking and sorting Cargo.toml dependency tables and related TOML tables.

### 项目历史

The project README says cargo-sort was created as an implementation of David Tolnay's request-for-implementation issue for alphabetically sorting Cargo.toml dependencies, and that it uses toml-edit to parse TOML.

### 采用历史

GitHub records the repository as created in June 2019, while crates.io records the cargo-sort crate as first published in May 2021. The input package facts list it in Homebrew, Alpine, Nix, and Arch packaging.

### 使用方式

The official README documents `cargo sort` as a cargo subcommand with default rewrite, check-only, print, workspace, custom table-order, grouped sorting, and `--config` modes.

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

cargo-sort matters to package maintainers because it turns Cargo.toml dependency ordering into a repeatable check, useful for CI and pre-commit workflows where noisy dependency diffs are annoying.

### 时间线

- 2019: GitHub repository created.
- 2021: First crates.io release recorded.
- 2026: crates.io records max_version 2.1.4.

### Related projects

- The README credits toml-edit as the TOML parser and links the original request-for-implementation issue.

### 来源

- <https://api.github.com/repos/DevinR528/cargo-sort>
- <https://github.com/DevinR528/cargo-sort>
- <https://github.com/DevinR528/cargo-sort#readme>
- <https://crates.io/api/v1/crates/cargo-sort>
- <https://formulae.brew.sh/api/formula/cargo-sort.json>


## 安全说明

narrow executable package without higher-risk signals.

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


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: tomlfmt.toml
## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** cargo-sort
- **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

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

- Nix - cargo-sort: normalized package name match | nixpkgs package indexes: pkgs/by-name/ca/cargo-sort/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - cargo-sort - 2.1.4-r0: normalized package name match | Alpine Linux edge package indexes: cargo-sort from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Check if tables and items in a .toml file are lexically sorted | https://github.com/DevinR528/cargo-sort
- pacman - cargo-sort - 2.1.4-1: normalized package name match | Arch Linux sync databases: cargo-sort from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Check if tables and items in a .toml file are lexically sorted | https://github.com/DevinR528/cargo-sort


## 相关链接

- [Source-control packages](https://pkg.so/zh-hans/source-control-tools/) - Belongs to a source-control command family.
- [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.
- [rust](https://pkg.so/zh-hans/brew/rust/) - Build dependency declared by Homebrew.
- [cargo-shear](https://pkg.so/zh-hans/brew/cargo-shear/) - Shares pkgdb curated category or tags: cargo-plugin, cli, developer-tools, rust.
- [cargo-show-asm](https://pkg.so/zh-hans/brew/cargo-show-asm/) - Shares pkgdb curated category or tags: cargo-plugin, cli, developer-tools, rust.
- [cargo-bundle](https://pkg.so/zh-hans/brew/cargo-bundle/) - Shares pkgdb curated category or tags: cli, developer-tools, rust.
- [cargo-binutils](https://pkg.so/zh-hans/brew/cargo-binutils/) - Shares pkgdb curated category or tags: cli, developer-tools, rust.
- [cargo-bloat](https://pkg.so/zh-hans/brew/cargo-bloat/) - Shares pkgdb curated category or tags: cli, developer-tools, rust.
- [dprint](https://pkg.so/zh-hans/brew/dprint/) - Shares pkgdb curated category or tags: cli, developer-tools, formatting, rust.
- [precious](https://pkg.so/zh-hans/brew/precious/) - Shares pkgdb curated category or tags: cli, developer-tools, formatting, linting.
- [editorconfig-checker](https://pkg.so/zh-hans/brew/editorconfig-checker/) - Shares pkgdb curated category or tags: cli, developer-tools, formatting, linting.
- [cargo-sort](https://pkg.so/zh-hans/cargo/cargo-sort/) - Same normalized package name exists in another local package ecosystem.

## Combined YAML source

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


## 来源

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