# Install yamlfmt with Homebrew, apk, Nix, pacman, scoop

Extensible command-line tool to format YAML files. Version 0.21.0 via Homebrew; verified from local package data.

## Install

```sh
sudo av install brew:yamlfmt
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install yamlfmt
```

  Evidence: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add yamlfmt
```

  Evidence: Alpine Linux edge package indexes: yamlfmt from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Nix (92%):

```sh
nix profile install nixpkgs#yamlfmt
```

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

- pacman (92%):

```sh
sudo pacman -S yamlfmt
```

  Evidence: Arch Linux sync databases: yamlfmt from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

### Windows

- Scoop (92%):

```sh
scoop install main/yamlfmt
```

  Evidence: Scoop official bucket manifest trees: bucket/yamlfmt.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

## Package facts

- **Package key:** brew:yamlfmt
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/yamlfmt>
- **Version:** 0.21.0
- **Source summary:** Extensible command-line tool to format YAML files
- **Homepage:** <https://github.com/google/yamlfmt>
- **Repository:** <https://github.com/google/yamlfmt>
- **Upstream docs:** <https://github.com/google/yamlfmt#readme>
- **License:** Apache-2.0
- **Source archive:** <https://github.com/google/yamlfmt/archive/refs/tags/v0.21.0.tar.gz>
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- yamlfmt (cli)
- yamlfmt (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: 0.21.0
- Local data: ok
- Upstream repository: https://github.com/google/yamlfmt
- Upstream latest detected: v0.21.0 (current)
- info: No package-manager update timestamp was available.
## Project history and usage

Google yamlfmt is a Go command-line formatter and library for YAML files. Its goals are explicit: be easy to distribute as a single binary, be extensible with custom formatters, and be usable as a library foundation for teams that need a customized YAML formatter.

### Project history

The repository was created on 2022-08-10. The README describes the project as an extensible formatter rather than only a fixed style tool: users can run the `yamlfmt` command, install it as a pre-commit hook, use a container image, or build on the library APIs.

The project grew around formatter backends and configuration. The default `basic` formatter serializes YAML through a fork of gopkg.in/yaml.v3, while the `kyaml` formatter targets Kubernetes YAML style. The docs also record caveats around YAML directives, anchors, aliases, line breaks, and line-length behavior, showing the practical complexity behind YAML formatting.

### Adoption history

yamlfmt has a broad package-manager footprint in the supplied data, including Homebrew, Nix, apk, pacman, and Scoop. Its README also presents Go installation, release binaries, pre-commit integration, and a container image, which fits modern developer-tool adoption through local hooks and CI checks.

The repository lives under the Google organization but the README states that it is not officially supported by Google and is maintained primarily by an individual maintainer in spare time. That makes it an interesting case where a high-visibility org namespace helped adoption of a still-community-paced developer tool.

### How it is used

Basic usage is `yamlfmt x.yaml y.yaml ...` or `yamlfmt .`, where directories are searched recursively for `.yaml` and `.yml` files. The `-dstar` mode enables doublestar glob matching, and `-lint` supports CI workflows that check formatting without rewriting files.

Configuration is discovered from a `-conf` flag, the working directory, ancestor directories, or a system config directory. Supported config filenames include `.yamlfmt`, `yamlfmt.yml`, `yamlfmt.yaml`, `.yamlfmt.yaml`, and `.yamlfmt.yml`.

### Why package nerds care

yamlfmt is package-nerd significant because it packages the messy YAML-formatting problem as a distributable Go binary with docs for hooks, containers, global config, and release artifact verification.

It also represents the split in YAML tooling between generic style normalization and domain-specific formats such as Kubernetes KYAML, a distinction that matters to maintainers choosing formatter defaults for large repositories.

### Timeline

- 2022-08-10: GitHub repository created.
- 2020s: Project goals documented around single-binary distribution, custom formatter extension, and library use.
- 2020s: Configuration discovery documented across local project files, ancestor search, and platform config directories.
- 2020s: README documented pre-commit, container, and CI usage patterns.

### Related projects

- Related projects and technologies include gopkg.in/yaml.v3, Kubernetes KYAML, pre-commit, bmatcuk/doublestar, cosign, and container-based CI runners.

### Sources

- <https://api.github.com/repos/google/yamlfmt>
- <https://github.com/google/yamlfmt>
- <https://raw.githubusercontent.com/google/yamlfmt/main/README.md>
- <https://raw.githubusercontent.com/google/yamlfmt/main/docs/config-file.md>


## 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: .yamlfmt, yamlfmt.yml, yamlfmt.yaml, .yamlfmt.yaml, .yamlfmt.yml, $XDG_CONFIG_HOME/yamlfmt/.yamlfmt, ~/.config/yamlfmt/.yamlfmt
- Windows: %LOCALAPPDATA%\yamlfmt\.yamlfmt
## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** yamlfmt
- **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 - yamlfmt: normalized package name match | nixpkgs package indexes: pkgs/by-name/ya/yamlfmt/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - yamlfmt - 0.21.0-r5: normalized package name match | Alpine Linux edge package indexes: yamlfmt from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | An extensible command line tool or library to format yaml files | https://github.com/google/yamlfmt
- apk - yamlfmt-doc - 0.21.0-r5: normalized package name match | Alpine Linux edge package indexes: yamlfmt-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | An extensible command line tool or library to format yaml files (documentation) | https://github.com/google/yamlfmt
- pacman - yamlfmt - 0.21.0-1: normalized package name match | Arch Linux sync databases: yamlfmt from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | An extensible command line tool or library to format yaml files. | https://github.com/google/yamlfmt
- Scoop - main/yamlfmt: normalized package name match | Scoop official bucket manifest trees: bucket/yamlfmt.json from https://api.github.com/repos/ScoopInstaller/Main/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.
- [gofumpt](https://www.automicvault.com/pkg/brew/gofumpt/) - Shares av.db curated category or tags: cli, developer-tools, formatter, go.
- [goimports](https://www.automicvault.com/pkg/brew/goimports/) - Shares av.db curated category or tags: cli, developer-tools, formatter, go.
- [yamlfix](https://www.automicvault.com/pkg/brew/yamlfix/) - Shares av.db curated category or tags: cli, developer-tools, formatter, yaml.
- [jsonfmt](https://www.automicvault.com/pkg/brew/jsonfmt/) - Shares av.db curated category or tags: cli, developer-tools, formatter.
- [jsonpp](https://www.automicvault.com/pkg/brew/jsonpp/) - Shares av.db curated category or tags: cli, developer-tools, formatter.
- [odinfmt](https://www.automicvault.com/pkg/brew/odinfmt/) - Shares av.db curated category or tags: cli, developer-tools, formatter.
- [pgformatter](https://www.automicvault.com/pkg/brew/pgformatter/) - Shares av.db curated category or tags: cli, developer-tools, formatter.
- [rubyfmt](https://www.automicvault.com/pkg/brew/rubyfmt/) - Shares av.db curated category or tags: cli, developer-tools, formatter.
- [dyff](https://www.automicvault.com/pkg/brew/dyff/) - Both packages work with overlapping file formats or content types. Shared terms: cli, configuration, developer, developer-tools, files.

## Combined YAML source

View the package source record on GitHub. [combined/yamlfmt.yml](https://github.com/automic-vault/db/blob/main/combined/yamlfmt.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
