macOS
brew install keep-sortedlocal Homebrew formula metadata
brew
Language-agnostic formatter that sorts selected lines. Version 0.9.1 via Homebrew; verified 2026-06-30.
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 | cli | global executable |
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.
https://github.com/google/keep-sorted
install metadata
| Package key | brew:keep-sorted |
|---|---|
| Version | 0.9.1 |
| Package manager | Homebrew |
| Package manager page | https://formulae.brew.sh/formula/keep-sorted |
| Homepage | https://github.com/google/keep-sorted |
| Repository | https://github.com/google/keep-sorted |
| Upstream docs | https://github.com/google/keep-sorted#readme |
| License | Apache-2.0 |
| Source archive | https://github.com/google/keep-sorted.git |
| Last updated | 2026-06-30T18:46:01Z |
| Pulse | updated |
| Build dependencies | go |
| Bottle | available (on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux) |
| Homebrew post-install | not defined |
| Service | none declared |
registry facts
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | keep-sorted |
| 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 |
|
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.