$brew install jq
Agent Compatibility
JSON Output
Agent Skill
MCP Support
AI Analysis
jq is a command-line JSON processor that runs filters over JSON from stdin or files and emits transformed results to stdout. It is a core shell primitive for inspecting, validating, reshaping, and generating structured data between other commands.
What It Enables
- Extract fields, filter arrays, join values, and reshape JSON payloads from APIs, config files, logs, and other CLI output.
- Validate and pretty-print JSON, or emit compact, sorted, raw-string, or JSON-seq output for downstream commands.
- Build JSON from scratch with
-n, pass structured values with--argjsonor--jsonargs, and handle very large documents with--stream.
Agent Fit
- Default stdout is structured JSON, and
-cor--seqkeep it easy to pipe into follow-up steps. - It works cleanly in non-interactive stdin or file workflows, with exit codes and stderr behavior that suit inspect, transform, and verify loops.
- Best used as a companion primitive around other tools that emit JSON; agents still need to learn jq syntax for complex reductions and streaming transforms.
Caveats
- It does not authenticate to services or mutate remote systems on its own; it only transforms local input and output streams.
- Shell quoting and the filter language are common failure points on first attempt, especially across different shells.