The formatter multiplexer.
treefmt streamlines running multiple code formatters across a repository with a single command. It provides a unified CLI, runs formatters in parallel, and only processes files that changed.
Download prebuilt binaries from the releases page, or install from source with Go or via Nix.
Releases: github.com/numtide/treefmt/releases
Initialize a config file and format your repo:
treefmt --inittreefmt
Discover flags and options:
treefmt --help
Define formatters in treefmt.toml
at the project root. Example:
[formatter.nix]command = "nixpkgs-fmt"includes = ["*.nix"]
[formatter.rust]command = "rustfmt"options = ["--edition", "2018"]includes = ["*.rs"]
See the formatter spec and supported tools attreefmt.com.