# Install jsonfmt with Homebrew, Nix

Like gofmt, but for JSON files. Version 0.5.2 via Homebrew; verified from local package data.

## Install

```sh
sudo av install brew:jsonfmt
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install jsonfmt
```

  Evidence: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#jsonfmt
```

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

## Package facts

- **Package key:** brew:jsonfmt
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/jsonfmt>
- **Version:** 0.5.2
- **Source summary:** Like gofmt, but for JSON files
- **Homepage:** <https://github.com/caarlos0/jsonfmt>
- **Repository:** <https://github.com/caarlos0/jsonfmt>
- **Upstream docs:** <https://github.com/caarlos0/jsonfmt#readme>
- **License:** MIT
- **Source archive:** <https://github.com/caarlos0/jsonfmt/archive/refs/tags/v0.5.2.tar.gz>
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

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

jsonfmt is a Go command-line formatter for JSON files, explicitly modeled as `gofmt` for JSON.

### Project history

Carlos Becker introduced jsonfmt in a November 12, 2018 blog post after needing consistent JSON formatting for a Chef-heavy project. The post describes rejecting heavier or awkward alternatives, then arriving at Go's standard `json.Indent` as the simple implementation core.

The GitHub repository was created in November 2018 and packages the formatter as a small static CLI with release artifacts for several installation paths.

### Adoption history

Adoption is practical and small-scale: Homebrew, Docker, apt/yum repository instructions, deb/rpm packages, and manual binaries are documented by the project. The intended users are teams that want JSON formatting in CI or pre-commit workflows without pulling in a larger JavaScript formatter stack.

### How it is used

The README documents `jsonfmt` for checking and `jsonfmt -w` for rewriting files. Becker's blog describes using `jsonfmt -w` locally and plain `jsonfmt` in CI so formatting drift fails the build.

### Why package nerds care

jsonfmt is notable as a minimal native alternative to general-purpose formatters. Its charm is that it mostly packages a standard-library behavior into a predictable CLI, which is exactly the sort of small tool package managers are good at preserving.

### Timeline

- 2018-11-07: The GitHub repository was created.
- 2018-11-12: The author published the `Keeping json files formatted` post.
- 2018-11-12: The blog documented Homebrew, Snapcraft, Docker, deb/rpm, and manual installation routes.
- 2026-06-02: GitHub repository metadata showed ongoing repository activity.

### Related projects

- jsonfmt is related to gofmt by naming and workflow, to jq and Prettier as alternative JSON formatting options, and to Go's `encoding/json` package through its implementation approach.

### Sources

- <https://api.github.com/repos/caarlos0/jsonfmt>
- <https://carlosbecker.com/posts/jsonfmt/>
- <https://formulae.brew.sh/formula/jsonfmt>
- <https://github.com/caarlos0/jsonfmt>
- <https://github.com/caarlos0/jsonfmt/releases>


## 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:** jsonfmt
- **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 - jsonfmt: normalized package name match | nixpkgs package indexes: pkgs/by-name/js/jsonfmt/package.nix from https://api.github.com/repos/NixOS/nixpkgs/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.
- [jsonpp](https://www.automicvault.com/pkg/brew/jsonpp/) - Shares av.db curated category or tags: cli, developer-tools, formatter, json.
- [gofumpt](https://www.automicvault.com/pkg/brew/gofumpt/) - Shares av.db curated category or tags: cli, developer-tools, formatter.
- [goimports](https://www.automicvault.com/pkg/brew/goimports/) - 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.
- [smlfmt](https://www.automicvault.com/pkg/brew/smlfmt/) - Shares av.db curated category or tags: cli, developer-tools, formatter.
- [yamlfix](https://www.automicvault.com/pkg/brew/yamlfix/) - Shares av.db curated category or tags: cli, developer-tools, formatter.
- [fracturedjson](https://www.automicvault.com/pkg/brew/fracturedjson/) - Both packages work with overlapping file formats or content types. Shared terms: but, cli, developer, developer-tools, formatter.
- [yamlfmt](https://www.automicvault.com/pkg/brew/yamlfmt/) - Local package facts share a topical domain. Shared terms: cli, developer, developer-tools, files, formatter.

## Combined YAML source

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