# Install cargo-sort with Homebrew, apk, Nix, pacman

Tool to check that your Cargo.toml dependencies are sorted alphabetically. Version 2.1.4 via Homebrew; verified from local package data. Also installable with nix: nix profile install nixpkgs#cargo-sort.

## Install

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

Additional install commands:

### macOS

- Homebrew (100%):

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

  Evidence: local Homebrew formula metadata

### Linux

- apk (92%):

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

  Evidence: 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
```

  Evidence: 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
```

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

## Package facts

- **Package key:** brew:cargo-sort
- **Package manager:** Homebrew
- **Version:** 2.1.4
- **Source summary:** Tool to check that your Cargo.toml dependencies are sorted alphabetically
- **Homepage:** <https://github.com/devinr528/cargo-sort>
- **Repository:** <https://github.com/devinr528/cargo-sort>
- **Generated:** 2026-08-03T19:37:03+00:00

## Executables

- cargo-sort (alias)

## Install behavior

- Bottle: not available

## Freshness

- Page generated: 2026-08-03
- Package-manager version: 2.1.4
## Project history and usage

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

### Project history

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.

### Adoption history

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.

### How it is used

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.

### Why package nerds care

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.

### Timeline

- 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.

### Sources

- <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>


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- 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
## Other Package-Manager Records

- 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


## Related links

- [cargo-sort](https://pkg.so/pkg/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)


## Sources

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