gojq
$ gojq Community Low Riskgojq 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.
brew install gojq gojq runs inline in shell pipelines to filter JSON and YAML (--yaml-input) before payloads ever enter LLM context.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
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
Pure offline stdin/file filter with zero network access, zero credential reads, and no in-place file mutation.
- Deterministic read-only stream processor
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
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
Well-maintained by itchyny under MIT license with high jq test-suite compatibility.
- Active
itchyny/gojqrepository under MIT license
Clear README documenting differences from C jq, YAML flags, and exit codes.
- Structured CLI and feature comparison in README
Security, Auth & Guardrails
None required; operates purely on stdin and local JSON/YAML files.
MIT open-source CLI; 100% free and offline.
# 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
gojq --yaml-input -c '.spec.containers[] | {name, image}' deployment.yaml Parses YAML directly without yq and projects minimal fields as single-line JSON.
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-inputand--yaml-outputeliminate needing separateyqinstalls. - + Preserves arbitrary-precision integers (fixing C
jq64-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
slurporinputshandling.