# 使用 Homebrew 安装 headson

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

## 安装

```sh
sudo av install brew:headson
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install headson
```

  证据: local Homebrew formula metadata

## 软件包事实

- **软件包键:** brew:headson
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/headson>
- **版本:** 0.17.0
- **来源摘要:** Head/tail for structured data
- **主页:** <https://docs.rs/headson/latest/headson/>
- **仓库:** <https://github.com/kantord/headson>
- **上游文档:** <https://docs.rs/headson/latest/headson/>
- **许可证:** MIT
- **源码归档:** <https://github.com/kantord/headson/archive/refs/tags/headson-v0.17.0.tar.gz>
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- hson (cli)
- hson (别名)

## 构建依赖

- rust

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 0.17.0
- 本地数据: OK
- 上游仓库: https://github.com/kantord/headson
- 检测到的最新版本: headson-v0.17.0 (当前)
- 信息: No package-manager update timestamp was available.
## 项目历史与用法

headson is a Rust CLI and Python library that acts like head or tail for structured data. Its executable, `hson`, previews JSON, YAML, text, and source files while respecting byte, character, or line budgets.

### 项目历史

The GitHub repository was created in October 2025. The README frames the project as a structure-aware alternative to head and tail for JSON and YAML, later extended to text and source-code summaries.

Early releases moved quickly through core CLI capabilities: multiple input files, global character limits, tail sampling, color output, YAML loading, auto format detection, grep-like inclusion, tree-style multi-file previews, and source-code heuristics. The release log shows the project settling on `headson` as the package name and `hson` as the installed command.

### 采用历史

Public adoption evidence is thin because the project is young and niche. Its upstream metadata, docs.rs page, and Homebrew formula show the intended audience: CLI users, shell scripts, and AI-agent or developer-tool workflows that need small previews of large structured files.

The package fills a modern command-line gap: traditional head and tail are line-oriented, while JSON and YAML often need tree-aware truncation to remain understandable after sampling.

### 使用方式

A common use is piping JSON to `hson -c 800` to get a compact preview under a strict byte budget. Other examples include previewing many JSON files with a global budget, rendering strict JSON, showing YAML with comments, preserving grep matches under tight budgets, and summarizing source files by indentation-aware outlines.

The tool can read stdin or file paths, recurse through directories, respect git-aware ordering for multi-file summaries, and expose the same functionality as a Python library.

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

headson is interesting to package nerds because it is a tiny Rust CLI that wraps a very specific terminal workflow: inspect enough of a structured file without dumping the whole thing. It is especially suited to package-manager installs because users expect small inspection tools to be globally available on PATH.

It also reflects a newer CLI niche shaped by large logs, machine-readable APIs, and AI-agent context budgets: budgeted previews are no longer just cosmetic, they are part of keeping command output useful.

### 时间线

- 2025-10: Repository created.
- 2025-10: v0.2.0 added support for multiple input files.
- 2025-10: v0.3.0 added tail-oriented sampling.
- 2025-10: v0.6.0 added color output.
- 2025-11: v0.6.2 added YAML loading and auto format detection features.
- 2025-11: v0.6.5 and v0.6.6 added line-based and Unicode character budget modes.

### Related projects

- Unix head and tail are the conceptual ancestors.
- jq, yq, grep, ripgrep, and tree are adjacent command-line tools whose workflows headson references or emulates.
- docs.rs and crates.io are part of the Rust packaging ecosystem around the project.
- Python packaging is relevant because the README documents a Python library alongside the CLI.

### 来源

- <https://api.github.com/repos/kantord/headson>
- <https://api.github.com/repos/kantord/headson/releases?per_page=100>
- <https://docs.rs/headson>
- <https://github.com/kantord/headson>
- <https://raw.githubusercontent.com/kantord/headson/main/README.md>


## 安全说明

narrow executable package without higher-risk signals.

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

## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** headson
- **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


## 相关链接

- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://pkg.so/zh-hans/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://pkg.so/zh-hans/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [Networking and protocol packages](https://pkg.so/zh-hans/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [rust](https://pkg.so/zh-hans/brew/rust/) - Build dependency declared by Homebrew.
- [yq](https://pkg.so/zh-hans/brew/yq/) - Shares pkgdb curated category or tags: cli, developer-tools, json, yaml.
- [python-yq](https://pkg.so/zh-hans/brew/python-yq/) - Shares pkgdb curated category or tags: cli, developer-tools, json, yaml.
- [libfyaml](https://pkg.so/zh-hans/brew/libfyaml/) - Shares pkgdb curated category or tags: cli, developer-tools, json, yaml.
- [dasel](https://pkg.so/zh-hans/brew/dasel/) - Shares pkgdb curated category or tags: cli, developer-tools, json, yaml.
- [yj](https://pkg.so/zh-hans/brew/yj/) - Shares pkgdb curated category or tags: cli, developer-tools, json, yaml.
- [dyff](https://pkg.so/zh-hans/brew/dyff/) - Shares pkgdb curated category or tags: cli, developer-tools, json, yaml.
- [spectral-cli](https://pkg.so/zh-hans/brew/spectral-cli/) - Shares pkgdb curated category or tags: cli, developer-tools, json, yaml.
- [otree](https://pkg.so/zh-hans/brew/otree/) - Shares pkgdb curated category or tags: cli, developer-tools, json, yaml.
- [jsongrep](https://pkg.so/zh-hans/brew/jsongrep/) - Both packages work with overlapping file formats or content types. Shared terms: cli, developer, developer-tools, json, structured.

## Combined YAML source

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


## 来源

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- cross-ecosystem install command graph
