headson

head and tail for structured data, within a strict byte budget

Image 1 of 1: hson previewing a JSON file under fixed byte, character and line budgets in the terminal

Previews JSON, YAML, text and source code within a budget of bytes, characters or lines, keeping structure and representative values. Works on one file or many, with grep-like and tree-like modes, as a CLI and a Python library.

Trade-offs

  • Source code outlined by an indentation-aware heuristic. Lines stay atomic, so omissions never split a line.
  • A binary search over the number of included nodes, looping between choosing N and a render attempt until the preview fits the budget.
  • An arena-style tree in flat, contiguous buffers, with arrays ingested in a single pass.

Q&A4

It can cut JSON in the middle of a value. hson stays structure-aware, and strict mode keeps the output machine-readable.

Reviews

Loading reviews

    More in Rust

    See all 146 →
    • PaganelData migration engine that verifies the destination down to the row
    • FeOxDBEmbedded key-value store in Rust with write-behind durability
    • AudioRouterVisual audio router for Windows 11: route, process and record on a canvas
    • ai-memoryPersistent memory for MCP clients in one Rust binary over SQLite
    • AntirionAI gateway in one Rust binary, with the admin console built in
    • jc-rsjc rewritten as one static binary that turns command output into JSON

    More in JSON

    See all 5 →
    • PandiaDesktop JSON editor for multi-gigabyte files, with the document held in Rust
    • JDFDocument format in plain JSON that renders like a PDF and diffs in git
    • celqCommand-line JSON processor that speaks Common Expression Language
    • TwigExplorer for JSON, YAML and HAR files in the terminal and the browser

    More in CLI tools

    See all 74 →
    • ZeroboxDeny-by-default process sandbox with per-host secret injection
    • blitcpFile copier that reads in disk order, dedupes and streams over raw SSH
    • pistachioDeclarative PostgreSQL schema management with a plan and apply workflow
    • quiverDump, load, copy and stream MySQL, MariaDB and TiDB from one consistent snapshot
    • haxMinimalist terminal coding agent written in C
    • roam-codeLocal code index and checks that coding agents can query