Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

jq

$ jq Community Low Risk
jqlang (OSS) · Database & Data · MIT · macos / linux / windows

jq is the universal Unix pipe companion that lets AI agents slice, reshape, and aggregate large JSON responses in shell pipelines before bringing data into their context window. Deterministic, offline, and dependency-free.

FCRS-1.0 Score
97 /100
Excellent
High Confidence
Zero-Friction Install
brew install jq
CLI vs MCP Decision CLI Only

jq runs locally inside shell pipelines to trim bloated JSON outputs from other CLIs or curl—making every other CLI far more token-efficient.

Agent-Readiness Checklist

Local Probe Evidence
✓ JSON Output
✓ Field Filtering
✓ Non-Interactive
— Dry-Run
✓ Read-Only Mode
✓ NO_COLOR Clean
— Self-Describing
— Official SKILL.md
Version
jq-1.7.1-apple
Startup
8 ms
Exit Codes (help / invalid)
0 / 2
NO_COLOR Clean / Non-TTY Safe
Yes / Safe
Captured --help excerpt
jq - commandline JSON processor [version 1.7.1-apple]

Usage:	jq [options] <jq filter> [file...]
	jq [options] --args <jq filter> [strings...]
	jq [options] --jsonargs <jq filter> [JSON_TEXTS...]

jq is a tool for processing JSON inputs, applying the given filter to
its JSON text inputs and producing the filter's results as JSON on
standard output.

The simplest filter is ., which copies jq's input to its output
unmodified except for formatting. For more advanced filters see
the jq(1) manpage ("man jq") and/or https://jqlang.github.io/jq/.

Example:

	$ echo '{"foo": 0}' | jq .
	{
	  "foo": 0
	}

Command options:
  -n, --null-input          use `null` as the single input value;
  -R, --raw-input           read each line as string instead of JSON;
  -s, --slurp               read all inputs into an array and use it as
                            the single input value;
  -c, --compact-output      compact instead of pretty-printed output;
  -r, --raw-output          output strings without escapes and quotes;
      --raw-output0         implies -r and output NUL after each output;
  -j, --join-output         implies -r and output without newline after
                            each output;
  -a, --ascii-output        output strings by only ASCII characters
                            using escape sequences;
  -S, --sort-keys           sort keys of each object on output;
  -C, --color-output        colorize JSON output;
  -M, --monochrome-output   disable colored output;
      --tab                 use tabs for indentation;
      --indent n            use n spaces for indentation (max 7 spaces);
      --unbuffered          flush output stream after each output;
      --stream              parse the input value in streaming fashion;
      --stream-errors       implies --stream and report parse error as
                            an array;
      --seq                 parse input/output as application/json-seq;
  -f, --from-file file      load filter from the file;
  -L directory              search modules from the directory;
      --arg name value      set $name to the string value;
      --argjson name value  set $name to the JSON value;
      --slurpfile name file set $name to an array of JSON values read
                            from the file;
      --rawfile name file   set $name to string contents of file;
      --args                consume remaining arguments as positional
                            string values;
      --jsonargs            consu

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 24 / 25

JSON-native by design: compact -c output, raw -r strings, -e exit-status assertions, and automatic color disabling when piped.

  • Supports -c compact JSON, -e exit-status mode, and NO_COLOR
Trust & Safety 25 / 25

Pure deterministic stream/file transformer with zero network calls or credential access.

  • Offline read-only JSON filter; writes only if shell stdout is redirected
Setup & Portability 15 / 15

Pre-installed on most developer/CI images and available via every package manager.

  • Lightweight C binary across macOS, Linux, and Windows
Utility & Efficiency 15 / 15

One of the highest-ROI tools an agent can use to shrink stdout payloads by 10x–50x.

  • Reduces verbose JSON payloads before entering LLM context
Maintenance & Lineage 9 / 10

Maintained by jqlang/jq under MIT license with active 1.7+ maintenance.

  • Maintained under jqlang GitHub organization
Docs & Verifiability 9 / 10

Clear official manual and widespread LLM fluency in jq filter syntax.

  • Official manual at jqlang.org/manual

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None required; operates on stdin or local JSON files.

Side Effects
Read-Only
Cost & Quotas

100% free, offline, MIT open-source.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# jq Agent Rules
- Pipe large `--json` responses from cloud/SaaS CLIs through `jq -c` to drop unused fields.
- Use `jq 'keys'` or `jq '.[0]'` to inspect unknown schemas before printing full arrays.

Agent-Ready Command Recipes

Safe Read-Only Queries

Project large JSON arrays to compact objects
cat payload.json | jq -c '[.items[] | {id, name, status}]'

Compacts multi-megabyte JSON into single-line minimal objects (-c) to save tokens.

Inspect top-level keys of an unfamiliar JSON file
jq 'keys' payload.json

Lets the agent discover structure without printing the entire file.

Strengths for Agents

  • + Acts as a universal context-window protector in shell pipelines (| jq -c).
  • + Zero side effects, instant startup, deterministic JSON output.
  • + -e flag enables clean boolean/null checks in automated scripts.

Caveats & Pitfalls

  • ! Complex nested jq expressions can occasionally trigger quoting mistakes in shell strings—prefer single quotes.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI