Updated Jul 15, 2026

Utilities

Flatten JSON into greppable assignments

Make JSON greppable.

Agent

overview

What gron does

gron turns nested JSON into one assignment per line so grep and other line tools can find values without a JSON query language.

Use --ungron to reverse the transform: keep the lines you want, rebuild valid JSON, and pass a subset downstream. --stream treats each input line as its own object; --json emits a JSON stream form.

Trickest provides it as a managed Utilities node between any JSON-emitting step and a filter that only needs a few fields from a file or URL.

source github.com/tomnomnom/gron

use cases

Where gron fits

Grep deep into JSON output

Flatten a tool's JSON into path assignments so a simple grep finds the exact nested field instead of eyeballing indented blobs.

Extract and rebuild a subset

Grep the gron lines you want, then ungron them back into valid JSON so a downstream step receives only the fields that matter.

Fetch and flatten an API response

Point gron at a URL so it pulls the JSON and flattens it in one step, ready for grep without a separate download node.

Handle JSON streams

Turn on stream mode to treat each input line as its own JSON object, flattening line-delimited JSON from another tool.

reference

gron inputs and flags

7 inputs
NameTypeFlagDescription
jsonBOOLEAN--jsonRepresent gron data as JSON stream
streamBOOLEAN--streamTreat each line of input as a separate JSON object
ungronBOOLEAN--ungronReverse the operation (turn assignments back into JSON)
no-sortBOOLEAN--no-sortDon't sort output (faster)
insecureBOOLEAN--insecureDisable certificate validation
urlSTRING·Input URL
fileFILE·Input file

Showing key inputs. gron exposes 7 inputs in total.

example

Run gron

gron · command
# gron: flatten JSON then grep a nested fieldgron --json data.json | grep 'username' 
sample output
json = {};json.users[0].id = 1;json.users[0].username = "alice";json.users[1].id = 2;json.users[1].username = "bob";json.meta.source = "https://api.example.com/v1";

guidance

Choosing gron

Use gron to search and filter JSON with grep, then --ungron to rebuild a subset. Prefer jq when you need a query language and complex transforms. gron fits when line tools are enough.

jq

Full JSON query language for filtering and transforming. gron favors grep and flat assignments over query syntax.

unfurl

Pulls parts out of URLs rather than JSON. A sibling tomnomnom utility for a related extraction job.

json2html

Renders JSON as HTML for reports. Readable view, not greppable assignments.

faq

gron questions

Run with --ungron on the kept assignment lines. Gron reconstructs valid JSON from that subset so a downstream step receives only the fields you filtered.

Run gron yourself

A JSON input feeds gron, which flattens it into greppable assignments and writes the extracted fields as a queryable output.

Facts on this page come from the live Trickest tool library.