# 使用 Homebrew, Nix 安装 jsonfmt

查看 jsonfmt 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

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

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install jsonfmt
```

  证据: local Homebrew formula metadata

### Linux

- Nix (92%):

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

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

## 软件包事实

- **软件包键:** brew:jsonfmt
- **软件包管理器:** Homebrew
- **版本:** 0.5.2
- **来源摘要:** Like gofmt, but for JSON files
- **主页:** <https://github.com/caarlos0/jsonfmt>
- **仓库:** <https://github.com/caarlos0/jsonfmt>
- **最后更新:** 2026-07-26T04:08:08+02:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- jsonfmt (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 0.5.2
## 项目历史与用法

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

### 项目历史

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 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.

### 使用方式

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.

### 为什么软件包爱好者会关心

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.

### 时间线

- 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.

### 来源

- <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>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 其他软件包管理器记录

- 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


## Combined YAML source

View the package source record on GitHub. [combined/jsonfmt.yml](https://github.com/mxcl/pkgdb/blob/main/combined/jsonfmt.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
