macOS
brew install keep-sortedlocal Homebrew formula metadata
brew / rank 5250
Language-agnostic formatter that sorts selected lines. Version 0.9.1 via Homebrew; verified 2026-07-27. Also installable with nix: nix profile install nixpkgs#keep-sorted.
install
brew install keep-sortedlocal Homebrew formula metadata
nix profile install nixpkgs#keep-sortednixpkgs package indexes · pkgs/by-name/ke/keep-sorted/package.nix · source: api.github.com
overview
Language-agnostic formatter that sorts selected lines
history
keep-sorted is Google's language-agnostic formatter for sorting marked blocks of lines inside larger files. Instead of trying to parse a whole language, it asks maintainers to mark regions with `keep-sorted start` and `keep-sorted end`, then sorts just those regions.
The GitHub repository was created on 2023-02-23. The README presents the tool as a general formatter for sorted blocks and documents installation through `go install` and pre-commit integration. Public GitHub releases began with the 0.1.x line in January 2024, followed by rapid feature growth around nested blocks, numeric sorting, YAML-style option lists, regex sorting, release binaries, and skip/group options.
Adoption is strongest in repositories that want deterministic ordering for generated-looking lists without adopting a language-specific formatter. The pre-commit hook documented in the README is the main adoption path: projects can enforce sorted blocks in review and CI while keeping the tool independent of file type.
Users wrap a section of code, configuration, documentation, or data with keep-sorted markers and run `keep-sorted` over files or stdin. Options on the marker control grouping, block parsing, case sensitivity, duplicate removal, descending order, regex-based sorting, and blank-line handling.
keep-sorted is package-nerdy because it solves a recurring maintenance itch with a tiny explicit contract: the source file says which lines are machine-sortable. That makes it a useful complement to gofmt-style whole-file formatters and to pre-commit-driven hygiene stacks.
security posture
narrow executable package without higher-risk signals.
green risk · low confidence · appliance
Before unattended agent use, check whether the tool reads plaintext credentials, writes remote state, publishes artifacts, or shells out to plugins.
executables
| Command | Kind | Exposure | Note |
|---|---|---|---|
keep-sorted | executable | indexed executable | Discovered from the local executable index. |
freshness
These signals separate page generation age, package-manager activity, and upstream release comparison. Version lag is warned only when an evidence URL and comparable versions are present.
install metadata
| Package key | brew:keep-sorted |
|---|---|
| Version | 0.9.1 |
| Package manager | Homebrew |
| Homepage | https://github.com/google/keep-sorted |
| Repository | https://github.com/google/keep-sorted |
| Last updated | 2026-07-27T21:58:38+02:00 |
| Pulse | updated |
| Bottle | not recorded |
| Service | none declared |
source database matches
Matches are pulled from external package-manager indexes and kept separate from local Automic Vault package links.
keep-sorted
nix profile install nixpkgs#keep-sortedsource trail
This page is generated by av-web from the private package SQLite artifact built by scripts/generate-pkg-sqlite.py.
View the package source record on GitHub.