# Install tfsort with Homebrew, Nix

CLI to sort Terraform variables and outputs. Version 0.7.1 via Homebrew; verified from local package data.

## Install

```sh
sudo av install brew:tfsort
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install tfsort
```

  Evidence: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#tfsort
```

  Evidence: nixpkgs package indexes: pkgs/by-name/tf/tfsort/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## Package facts

- **Package key:** brew:tfsort
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/tfsort>
- **Version:** 0.7.1
- **Source summary:** CLI to sort Terraform variables and outputs
- **Homepage:** <https://github.com/AlexNabokikh/tfsort>
- **Repository:** <https://github.com/AlexNabokikh/tfsort>
- **Upstream docs:** <https://github.com/AlexNabokikh/tfsort#readme>
- **License:** Apache-2.0
- **Source archive:** <https://github.com/AlexNabokikh/tfsort/archive/refs/tags/v0.7.1.tar.gz>
- **Generated:** 2026-07-08T18:08:21+00:00

## Executables

- tfsort (cli)
- tfsort (alias)

## Build dependencies

- go

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, sonoma, ventura, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 0.7.1
- Local data: ok
- Upstream repository: https://github.com/AlexNabokikh/tfsort
- Upstream latest detected: v0.7.1 (current)
- info: No package-manager update timestamp was available.
## Project history and usage

tfsort is a small Terraform/HCL formatting utility. Its README describes a CLI for alphabetically sorting Terraform `variable`, `output`, `locals`, and `terraform` blocks, while also cleaning spacing and leading or trailing newlines.

### Project history

The project was created by Alexander Nabokikh and is distributed as a Go-based command-line tool. Its release page shows continuing releases through v0.7.1 in July 2025.

### Adoption history

The README documents installation through Homebrew, Nix, Chocolatey, Go install, binary releases, and source builds. The input metadata records Homebrew and Nix packaging.

### How it is used

The package-nerd use case is local cleanup of Terraform repositories: run `tfsort` on a file, feed it stdin, or process a directory recursively. The README documents dry-run mode and recursive processing while skipping `.git`, `.terraform`, and `.terragrunt-cache`.

### Why package nerds care

tfsort sits in the small-tool layer around Terraform: it does not replace `terraform fmt`, but gives users a packageable CLI for opinionated ordering of common HCL blocks in `.tf`, `.hcl`, and `.tofu` files.

### Timeline

- 2023-02-24: The GitHub releases page lists tfsort v0.2.1.
- 2025-07-14: The GitHub releases page lists tfsort v0.7.1.
- 2026: The input metadata records tfsort in Homebrew and Nix.

### Related projects

- tfsort is adjacent to Terraform, OpenTofu, Terragrunt, and other HCL formatting or linting tools used before review and CI.

### Sources

- <https://github.com/AlexNabokikh/tfsort README>
- <https://github.com/AlexNabokikh/tfsort/releases>
- source_facts.package-manager


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals

## Source Database Details

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

## Other Package-Manager Records

- Nix - tfsort: normalized package name match | nixpkgs package indexes: pkgs/by-name/tf/tfsort/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## Related links

- [Cloud CLI packages](https://www.automicvault.com/pkg/cloud-clis/) - Belongs to a cloud or infrastructure command family.
- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [go](https://www.automicvault.com/pkg/brew/go/) - Build dependency declared by Homebrew.
- [iam-policy-json-to-terraform](https://www.automicvault.com/pkg/brew/iam-policy-json-to-terraform/) - Shares av.db curated category or tags: cli, developer-tools, infrastructure-as-code, terraform.
- [tfschema](https://www.automicvault.com/pkg/brew/tfschema/) - Shares av.db curated category or tags: cli, developer-tools, infrastructure-as-code, terraform.
- [tfstate-lookup](https://www.automicvault.com/pkg/brew/tfstate-lookup/) - Shares av.db curated category or tags: cli, developer-tools, infrastructure-as-code, terraform.
- [tfupdate](https://www.automicvault.com/pkg/brew/tfupdate/) - Shares av.db curated category or tags: cli, developer-tools, infrastructure-as-code, terraform.
- [k2tf](https://www.automicvault.com/pkg/brew/k2tf/) - Shares av.db curated category or tags: cli, developer-tools, infrastructure-as-code, terraform.
- [terraform-inventory](https://www.automicvault.com/pkg/brew/terraform-inventory/) - Shares av.db curated category or tags: cli, developer-tools, infrastructure-as-code, terraform.
- [terraform-module-versions](https://www.automicvault.com/pkg/brew/terraform-module-versions/) - Shares av.db curated category or tags: cli, developer-tools, infrastructure-as-code, terraform.
- [terraform_landscape](https://www.automicvault.com/pkg/brew/terraform-landscape/) - Shares av.db curated category or tags: cli, developer-tools, infrastructure-as-code, terraform.

## Combined YAML source

View the package source record on GitHub. [combined/tfsort.yml](https://github.com/automic-vault/db/blob/main/combined/tfsort.yml)


## Sources

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