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.
インストール方法
Homebrew
$ brew install jq Debian/Ubuntu
$ sudo apt install jq Windows
$ winget install jqlang.jq よく使うコマンド
Read a field · 安全
$ jq -r '.name' package.json Extracts one value from JSON.
Filter array items · 安全
$ jq '.items[] | select(.status == "open")' Filters structured arrays.
Overwrite a file · 要確認
$ jq '.version = "1.0.1"' package.json > tmp && mv tmp package.json Changes a file and should be treated as an edit.
Agent 使用例
Codex CLI
Use jq for JSON inspection and small transformations. Show the filter before overwriting files. 安全メモ
- 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.
Agent が使えること
jq は一時的なパーサを書かずに JSON を安定して調べ、変換できます。
向いている用途
API レスポンス、パッケージメタデータ、ログ、ロックファイル、JSON 出力を持つコマンドに適しています。