Miller
$ mlr Community Low RiskMiller (mlr) is a single-binary Go tool for querying, reshaping, aggregating, and converting name-indexed data formats including CSV, TSV, JSON, JSON Lines, and DKVP. Built for Unix pipelines with --icsv --ojson format flags, filter, stats1, and in-place -I editing.
brew install miller mlr --icsv --ojson converts and aggregates tabular data into clean JSON in one streaming command—faster and more deterministic than custom Python scripts.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
First-class --ojson / --ojsonl / --c2j format conversions, field-name addressing, composable then verbs, and clean streaming exit codes.
- Supports
--icsv --ojson,--ojsonl,--c2j, andthenpipelines
Read-only stdout stream processor by default; local file edits require explicit -I or shell redirection.
- Pure stream processor; explicit
-Irequired for in-place edits
Single static Go binary across macOS, Linux, and Windows via Homebrew, apt, Scoop, and Releases.
- Static Go binary (
brew install miller)
Bridges CSV, TSV, JSON, NDJSON, and key-value logs cleanly with SQL-like stats1, join, and put.
- Header-aware
awk/sed/cut/joinacross CSV and JSON
Mature, actively maintained johnkerl/miller v6 under BSD-2-Clause.
- Active
johnkerl/millerrepository
Thorough ReadTheDocs manual, though Miller's DSL syntax ($field, then) takes brief familiarity.
- Official docs at miller.readthedocs.io
Security, Auth & Guardrails
None; operates purely on local files and stdin/stdout streams.
100% free and BSD-2-Clause open-source.
# Miller (mlr) Agent Rules - Always specify explicit input/output format flags like `--icsv --ojson` or `--c2j`. - Chain verbs with `then` and cap row output with `head -n <N>` before printing to stdout. - Avoid `-I` (in-place file rewrite) until you have verified the expression on stdout.
Agent-Ready Command Recipes
Safe Read-Only Queries
mlr --icsv --ojson filter '$status == "active"' then head -n 20 users.csv
Filters rows by column name and outputs structured JSON without loading the whole file into context.
mlr --icsv --ojson stats1 -a count,sum,mean -f amount -g category sales.csv
Aggregates counts, sums, and means grouped by category and emits JSON.
Controlled Writes & Previews
mlr --icsv --ojsonl clean-whitespace input.csv > clean.jsonl
Trims whitespace across all fields and writes streaming NDJSON output.
Strengths for Agents
- + Converts effortlessly between CSV, TSV, JSON, NDJSON, and DKVP via
--c2j,--j2c,--icsv --ojson. - + Header-aware expressions eliminate brittle
awkcolumn-number indexing. - + Zero-dependency static Go binary streams large datasets cleanly.
Caveats & Pitfalls
- ! DSL quoting rules (
'$col == "x"') andthenverb chaining differ slightly fromjqand SQL.