talira

Command-line JSON processor

open sourceMITself-hostablefree

jq is a lightweight, flexible command-line JSON processor, akin to sed, awk and grep for JSON. It slices, filters, maps and transforms structured data with its own filter language, is written in portable C with zero runtime dependencies, and has an online playground.

Ways to install

Problems it solves

  • extract one field from a big JSON API response in a shell script
  • pretty-print minified JSON in the terminal
  • filter an array of JSON objects by a property from the command line
  • transform JSON into a different shape without writing a Python script
  • parse JSON in bash without fragile grep and sed
  • turn JSON output into CSV or plain lines for other tools
  • count or sum values in a JSON file quickly
  • build a JSON payload safely from shell variables

Features

  • filter language
  • pretty printing
  • zero dependencies
  • Docker image
  • online playground

Capabilities

Has a command line toolplan not known

Alternatives

The same job

These do what jq does.

  1. fx A terminal JSON viewer and processor
  2. gron Make JSON greppable!
  3. Miller Like awk, sed, cut, join and sort for CSV, TSV and JSON
  4. yq A portable command-line YAML, JSON, XML, CSV, TOML, HCL and properties processor
  5. Nushell A new type of shell

Compare jq with the top 3