gron transforms JSON into discrete assignments to make it easier to grep for what you want https://github.com/tomnomnom/gron
Miller is like awk, sed, cut, join, and sort for data formats such as CSV, TSV, JSON, JSON https://github.com/johnkerl/miller
Tools can parse it as JSON and that’s it.
This is the first I'm hearing of gron, but adding here for completeness sake. Meanwhile, JSON seems to be becoming a standard for CLI tools. Ideal scenario would be if every CLI tool has a --json flag or something similar, so that jc is not needed anymore.
https://github.com/tomnomnom/gron
I've been using `jq` for years and I'm always able to cobble together what I need, but I have yet to find it intuitive and I'm rarely able to arrive at a solution of any complexity without spending a lot of time reading its documentation. I wish I found it easier to use. :-(
Takes all the tree and hierarchy management away, makes it so ordering doesn’t matter.
If I’m generating JSON from batch scripts it’s my preferred tool (easier than fighting jq for many tasks)
It takes JSON input and produces flat, key-value output based on the path to the value. Usage with grep was obviously the original intention, but I've used it to help me better understand a given JSON's structure, too, which I then usually reflect back into a program that's consuming that JSON.
It also supports "ungron" too, so, for example, `gron some.json | grep -v "thing I don't want" | gron -u > filtered.json" makes for quick filtering of a JSON. I find it more user friendly than jq's language.
- Pipe into gron (https://github.com/tomnomnom/gron) to get a `foo.bar.baz = val` kind of syntax.
- Pipe into visidata (https://www.visidata.org/) to get a spreadsheet-like editable view.
Discussion: https://news.ycombinator.com/item?id=25006277 366 points | Nov 6, 2020 | 91 comments