Pure Go implementation of jq for JSON querying, filtering, and transformations in portable scripts.
$brew install gojq
Agent Compatibility
JSON Output
Agent Skill
MCP Support
AI Analysis
gojq is a portable jq implementation for querying and transforming structured data from stdin or files, with optional YAML input and output support. It is mainly a shell primitive for inspecting and reshaping JSON between other commands.
What It Enables
- Extract fields, filter arrays, and reshape API responses, logs, or config files inside shell pipelines.
- Read JSON or YAML from stdin or files, apply jq-style expressions, and emit JSON, compact JSON, raw strings, or YAML for downstream steps.
- Build repeatable data-processing steps with query files, variable injection, slurp and stream modes, and file-based module loading.
Agent Fit
- stdin and stdout behavior is predictable, flags are non-interactive, and
--exit-statushelps scripts branch on query results. - Structured output is a core strength here: JSON is the default stdout format, with compact and raw modes available when shell composition needs them.
- Best used as glue alongside service CLIs or HTTP calls, where an agent needs to inspect, normalize, or transform structured payloads before the next command.
Caveats
- Compatibility is close to
jqbut not exact: the README documents missing flags, unsupported functions, and differences such as object key ordering behavior. - This is a data-processing primitive, not a service CLI, so it only becomes useful in a larger workflow when paired with other commands or files.