Filtering JSON Without Learning jq Syntax
jq is brilliant once you know it — and famously opaque if you don't. Getting "the names of users over 25, sorted by age" shouldn't require memorizing .[] | select(.age > 25) | .name.
The same query as named steps
With the free Transmute CLI, a transformation is a list of steps with plain names:
$ transmute users.json --pipe '[ {"op":"filter","expr":"item.age > 25"}, {"op":"sort","by":"age"}, {"op":"pick","fields":["name","age"]} ]'
Each step does one obvious thing:
| Step | What it does |
|---|---|
filter | Keep rows where an expression is true (item.age > 25) |
map | Transform each row (item.price * 1.25) |
sort | Order by a key, ascending or descending |
unique | Deduplicate by a key (or whole rows) |
group | Group rows by a key, with counts |
pick / omit | Select or drop fields |
rename | Rename columns via a mapping |
head / tail | First/last N rows |
count | Row count |
When jq is still the right answer
- You already know jq well — switching has no upside for you.
- Deeply recursive transformations over arbitrary tree shapes.
- You're inside a constrained environment where adding any tool is off-limits anyway (then neither helps).
Honest take: if your queries fit in the table above, named steps are easier to write, easier to read six months later, and easier to explain to a teammate. If they don't, learn jq properly — it pays off.
Chaining formats too
Steps compose freely with format conversion, so CSV in, filtered YAML out, is one command, not three tools glued together in shell:
$ cat events.csv | transmute --pipe '[{"op":"unique","by":"user"},{"op":"head","n":10}]' --output yaml