jq

jq

Portable, zero-dependency C command-line JSON processor for slicing, filtering, mapping, and transforming structured API data.

★ 36.6K

Slice, filter, and reshape complex JSON payloads in a single shell pipeline

Trying to extract nested fields from a Kubernetes API response or AWS CLI output using `grep` and `sed` breaks the moment a JSON payload changes whitespace or key order. jq is a lightweight, zero-dependency functional programming language written in portable C specifically for transforming JSON streams. With 36.6K GitHub stars and 2,300 forks under the MIT license, it is installed on nearly every production Linux server and CI runner on the planet.

Core operations that make jq indispensable

  • Concise path expressions (`.items[] | select(.status == “Running”) | {name: .metadata.name, ip: .status.podIP}`) filter and reshape deep JSON trees in one line.
  • Streaming parser mode (`jq –stream`) processes multi-gigabyte JSON and JSONL log files in constant memory without loading the entire document into RAM.
  • Built-in math, regex, string interpolation, array grouping (`group_by`), and `@csv`/`@tsv`/`@base64` formatters turn raw API responses into ready-to-use reports.
  • Single static C binaries drop cleanly into minimal scratch containers, initramfs images, or air-gapped servers with zero runtime libraries.

Syntax tips for newcomers

Advanced `jq` reducers (`reduce`, `foreach`) and variable bindings can look dense at first, so test complex expressions interactively at `play.jqlang.org` or inside an `fzf` live preview loop. Pipe your next verbose `curl` or `docker inspect` output into `jq .` today for instant pretty-printed clarity.

Ready to try jq?

Experience the full capabilities on their official website.

Visit Official Website