95 /100
One of the safest and most useful CLIs for agents that inspect JSON.
Structured output 100/100
Whether the CLI can return JSON, YAML, or stable machine-readable output.
Non-interactive use 96/100
Whether common workflows can run predictably without an interactive prompt.
Safety boundaries 90/100
Whether read-only, dry-run, scoped auth, and destructive command boundaries are clear.
Install options
Homebrew
$ brew install jq Debian/Ubuntu
$ sudo apt install jq Windows
$ winget install jqlang.jq Common commands
Read a field · safe
$ jq -r '.name' package.json Extracts one value from JSON.
Filter array items · safe
$ jq '.items[] | select(.status == "open")' Filters structured arrays.
Overwrite a file · requires review
$ jq '.version = "1.0.1"' package.json > tmp && mv tmp package.json Changes a file and should be treated as an edit.
Agent usage examples
Codex CLI
Use jq for JSON inspection and small transformations. Show the filter before overwriting files. Safety notes
- jq is read-only unless shell redirection overwrites a file.
- Agents should avoid complex filters when a simpler projection is enough.
- Use -e when exit codes need to signal missing or invalid values.
What agents can use it for
jq gives agents a deterministic way to inspect and reshape JSON without writing a temporary parser.
Best fit
Use it for API responses, package metadata, logs, lockfiles, and any command output that already supports JSON.