# Install treefmt with Homebrew, MacPorts, Nix

One CLI to format the code tree. Version 2.5.0 via Homebrew; verified 2026-06-29.

## Install

```sh
sudo av install brew:treefmt
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install treefmt
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install treefmt
```

  Evidence: MacPorts ports tree: devel/treefmt/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#treefmt
```

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

## Package facts

- **Package key:** brew:treefmt
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/treefmt>
- **Version:** 2.5.0
- **Source summary:** One CLI to format the code tree
- **Homepage:** <https://treefmt.com/latest/>
- **Repository:** <https://github.com/numtide/treefmt>
- **Upstream docs:** <https://treefmt.com/latest>
- **License:** MIT
- **Source archive:** <https://github.com/numtide/treefmt/archive/refs/tags/v2.5.0.tar.gz>
- **Last updated:** 2026-06-29T12:01:53Z
- **Generated:** 2026-07-08T18:08:21+00:00

## Executables

- treefmt (cli)
- treefmt (alias)

## Build dependencies

- go

## Install behavior

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

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 2.5.0
- Package-manager updated: 2026-06-29
- Local data: ok
- Upstream repository: https://github.com/numtide/treefmt
- Upstream latest detected: v2.5.0 (current)
## Project history and usage

treefmt is a formatter multiplexer: one CLI that runs the right formatters across a source tree from a project-level configuration file.

### Project history

Numtide's README explains treefmt as a response to polyglot repositories, where each language brings its own formatter and teams repeatedly reimplement scripts to run them. treefmt turns that recurring script into one command.

The project emphasizes a unified CLI and output, parallel execution, and tracking changed files so that formatting does not always have to scan and rewrite an entire repository. Its documentation centers the `treefmt.toml` file in the project root as the place where formatter commands, options, and include globs are declared.

By 2026 the GitHub repository had multiple major releases, Go and Nix build metadata, and related tooling such as treefmt-nix, reflecting its adoption in Nix-heavy and polyglot development workflows.

### Adoption history

treefmt's adoption is closely tied to repositories that do not want language-specific formatting scripts in every project. It is packaged by Homebrew, MacPorts, and Nix, and the upstream README explicitly points Nix users at treefmt-nix.

For package users, the attraction is boring consistency: install one binary, commit one `treefmt.toml`, and let CI or pre-commit workflows run all configured formatters the same way.

### How it is used

A project usually creates `treefmt.toml` with `treefmt --init`, defines formatter sections with command, options, and include globs, and then runs `treefmt` from the project root.

Package nerds use it to standardize formatting across Nix, Rust, Go, JavaScript, and other mixed-language repos without maintaining a custom shell script per repository.

### Why package nerds care

treefmt is significant because it packages repository formatting as a composable CLI rather than a pile of local scripts. That matters to reproducible developer environments, especially where Nix flakes and CI expect declarative tooling.

### Timeline

- Project docs: treefmt is presented as the formatter multiplexer.
- 2026: v2.5.0 release adds formatter option support and Go toolchain updates.
- 2026: The repository records roughly a thousand stars, dozens of releases, and continued maintenance.

### Related projects

- treefmt-nix wraps treefmt for Nix-based configuration and formatter provisioning.
- Related tools named upstream include EditorConfig, Prettier, Super-Linter, and pre-commit.

### Sources

- <https://github.com/numtide/treefmt>
- <https://github.com/numtide/treefmt/releases>
- <https://treefmt.com/latest/>


## 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: treefmt.toml
## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** treefmt
- **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 - treefmt: normalized package name match | nixpkgs package indexes: pkgs/by-name/tr/treefmt/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- MacPorts - treefmt: normalized package name match | MacPorts ports tree: devel/treefmt/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Related links

- [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.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [go](https://www.automicvault.com/pkg/brew/go/) - Build dependency declared by Homebrew.
- [golines](https://www.automicvault.com/pkg/brew/golines/) - Shares av.db curated category or tags: cli, code-formatting, developer-tools, formatter, formatting.
- [bcpp](https://www.automicvault.com/pkg/brew/bcpp/) - Shares av.db curated category or tags: cli, developer-tools, formatter, formatting.
- [keep-sorted](https://www.automicvault.com/pkg/brew/keep-sorted/) - Shares av.db curated category or tags: cli, developer-tools, formatter, formatting.
- [ormolu](https://www.automicvault.com/pkg/brew/ormolu/) - Shares av.db curated category or tags: cli, code-formatting, developer-tool, developer-tools, formatter.
- [sqlfmt](https://www.automicvault.com/pkg/brew/sqlfmt/) - Shares av.db curated category or tags: cli, developer-tools, formatter, formatting.
- [tex-fmt](https://www.automicvault.com/pkg/brew/tex-fmt/) - Shares av.db curated category or tags: cli, developer-tools, formatter, formatting.
- [dockerfmt](https://www.automicvault.com/pkg/brew/dockerfmt/) - Shares av.db curated category or tags: cli, code-formatting, developer-tools, formatter.
- [fracturedjson](https://www.automicvault.com/pkg/brew/fracturedjson/) - Shares av.db curated category or tags: cli, developer-tool, developer-tools, formatter.

## Combined YAML source

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


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- 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
