Pure Go implementation of jq command-line JSON processor with arbitrary-precision arithmetic and YAML support
gojq is a pure Go implementation of the jq command-line JSON processor. It processes JSON data using jq's query language syntax, supporting operations like filtering, mapping, and transforming structured data. The tool can be used both as a standalone command-line utility and embedded as a Go library.
Unlike the original jq, gojq is completely portable with no C dependencies and supports arbitrary-precision integer arithmetic, preventing precision loss with large numbers. It includes additional features like YAML input/output support (--yaml-input and --yaml-output flags), string indexing, and improved time formatting functions. The tool maintains compatibility with most jq functionality while fixing several behavioral issues present in the original implementation.
Developers working with JSON data processing, API responses, or configuration files will find gojq useful for command-line data manipulation tasks. The Go library interface allows integration into applications that need programmatic JSON querying capabilities, with functions like gojq.Parse() for query compilation and iterator-based result processing.
# via Homebrew
brew install gojq
# via Go
go install github.com/itchyny/gojq/cmd/gojq@latest
# via mise
mise use -g gojq@latest