# jq for JSON processing in agent workflows
A small, scriptable JSON processor that helps agents inspect API responses, package files, and logs.
Agent Readiness Score: 95/100
One of the safest and most useful CLIs for agents that inspect JSON.
## Install

- Homebrew: `brew install jq`
- Debian/Ubuntu: `sudo apt install jq`
- Windows: `winget install jqlang.jq`

## Structured output

Supported output formats: json, text.
Prefer structured output flags such as `--json`, `--format json`, or equivalent when available.

## Safe commands

- Read a field: `jq -r '.name' package.json` — Extracts one value from JSON.
- Filter array items: `jq '.items[] | select(.status == "open")'` — Filters structured arrays.

## Commands requiring approval

- Overwrite a file: `jq '.version = "1.0.1"' package.json > tmp && mv tmp package.json` — requires-review; require explicit user approval.

## Agent instructions

- 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.

## Metadata

Official URL: https://jqlang.github.io/jq/
GitHub: https://github.com/jqlang/jq
Docs: https://jqlang.github.io/jq/manual/
