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

gojq

$ gojq Community Low Risk
itchyny · Database & Data · MIT · macos / linux / windows

gojq is a drop-in pure Go implementation of jq featuring arbitrary-precision integer arithmetic, improved error messages, and native YAML parsing/serialization (--yaml-input / --yaml-output). Deterministic, offline, and ideal for agents trimming JSON or YAML configs and API responses.

FCRS-1.0 Score
95 /100
Excellent
Medium Confidence
Zero-Friction Install
brew install gojq
CLI vs MCP Decision CLI Only

gojq runs inline in shell pipelines to filter JSON and YAML (--yaml-input) before payloads ever enter LLM context.

Agent-Readiness Checklist

✓ JSON Output
✓ Field Filtering
✓ Non-Interactive
— Dry-Run
✓ Read-Only Mode
✓ NO_COLOR Clean
— Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 24 / 25

JSON/YAML-native with -c compact, -r raw, -e exit-status, -M monochrome, --yaml-input, --yaml-output, and clear line/column query errors.

  • Supports -c, -r, -e, -M, --yaml-input, and --yaml-output
Trust & Safety 25 / 25

Pure offline stdin/file filter with zero network access, zero credential reads, and no in-place file mutation.

  • Deterministic read-only stream processor
Setup & Portability 15 / 15

Single static Go binary with zero C dependencies, installable via brew install gojq, go install, and GitHub releases across all major OSes.

  • Zero-dependency static Go binary on macOS, Linux, and Windows
Utility & Efficiency 15 / 15

Handles both JSON and YAML in one binary (--yaml-input / --yaml-output), saving massive context tokens in DevOps and API workflows.

  • Dual JSON + YAML filtering with arbitrary-precision integers
Maintenance & Lineage 8 / 10

Well-maintained by itchyny under MIT license with high jq test-suite compatibility.

  • Active itchyny/gojq repository under MIT license
Docs & Verifiability 8 / 10

Clear README documenting differences from C jq, YAML flags, and exit codes.

  • Structured CLI and feature comparison in README

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None required; operates purely on stdin and local JSON/YAML files.

Side Effects
Read-Only
Cost & Quotas

MIT open-source CLI; 100% free and offline.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# gojq Agent Rules
- Use `gojq --yaml-input -c` to extract exact fields from Kubernetes/Compose YAML manifests in one step.
- Pass `-M` (`--monochrome-output`) if ANSI colors appear, and `-e` for boolean exit-code assertions.

Agent-Ready Command Recipes

Safe Read-Only Queries

Query a YAML file and emit compact JSON
gojq --yaml-input -c '.spec.containers[] | {name, image}' deployment.yaml

Parses YAML directly without yq and projects minimal fields as single-line JSON.

Transform JSON and output clean YAML
gojq --yaml-output '.items | map({id, enabled})' config.json

Filters a JSON array and formats the result as YAML (--yaml-output).

Strengths for Agents

  • + Native --yaml-input and --yaml-output eliminate needing separate yq installs.
  • + Preserves arbitrary-precision integers (fixing C jq 64-bit float rounding on large IDs).
  • + Clearer query syntax error messages and pure Go static portability.

Caveats & Pitfalls

  • ! Very rare GNU/Oniguruma regex edge cases behave slightly differently from C jq.
  • ! Complex multi-document YAML streams require slurp or inputs handling.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI