BeCuriouzLearn something new every day
The 30KB program that tamed JSON on the command line
💡 jq is a dependency-free C tool that turns messy JSON into something you can query like a database, right from the command line.
Every API you touch spits out JSON, but the shell tools we've used for decades — grep, sed, awk — think in lines of text, not nested objects. jq fills that gap: it's a tiny command-line tool that lets you slice, filter, and reshape JSON with a compact query language. Pipe some JSON into it and write .users[].name to pull every user's name, or .[] | select(.age > 30) to keep only certain records.
What surprises newcomers is that jq isn't just a filter — it's a real functional programming language. It has variables, recursion, and user-defined functions, and it's Turing-complete, meaning you could (masochistically) compute anything with it. Yet the whole thing is written in portable C with no dependencies, so a single small binary runs almost anywhere, which is why it ships in countless scripts, CI pipelines, and Docker containers.
The project has a notable twist in its history. jq was created by Stephen Dolan around 2012, but development stalled for years as the original maintainers moved on. In 2023 the community formally adopted it: the repository moved to a new jqlang organization run by a team of volunteers, and after a long quiet period it got a fresh release — a textbook example of open source outliving any single author.
Source: jqlang/jq on GitHub