Story

Show HN: Grab – A declarative stream processor for delimited text data

anwitars Friday, March 13, 2026

I built grab because I wanted a more readable way to handle delimited data (CSV, TSV, whitespace) than the usual mix of awk and cut. It replaces cryptic 'schema' like $11 with a declarative one.

The goal was to build something with just enough features to serve a better UX while staying fast enough to stay out of the way.

  ps aux | grab -d whitespace -m user,pid,cpu,mem,_:4,start,time,command:gj --json --skip 1
  # Result:
  # {"user":"root","pid":"1","cpu":"0.0","mem":"0.0","start":"Mar10","time":"0:03","command":"/sbin/init"}
  # ...

  
Key points:

- Readable mappings: Define schemas like <name> to map columns to fields, with support for <name>:N for aggregating multiple columns into arrays, <name>:g for greedy mapping (into arrays), _ to skip columns and even <name>:Nj to join multiple columns into a single field.

- Performance: Zero-copy tokenization in Rust. It processes ~17.1M fields/sec. On my machine, it shapes a ps aux dump into JSON in about 13ms.

- Schema enforcement: By default, it tells you exactly which line failed and why on stderr, rather than silently producing garbled data.

- Small & static: Single 800KB binary, zero dependencies.

I’m sharing it now to see if this "schema-first" approach to shell piping feels as useful to others as it has been for me.

Repo: https://github.com/anwitars/grab

Crates.io: https://crates.io/crates/grab-cli

Summary
The article discusses the Grab open-source project, which is a command-line tool for managing dependencies and building Go applications. It provides a simple and efficient way to vendor dependencies, build and distribute Go applications, and manage version control.
1 0
Summary
github.com
Visit article Read on Hacker News