jq is a lightweight and flexible command-line JSON processor akin to sed,awk,grep, and friends for JSON data. It's written in portable C and has zero runtime dependencies, allowing you to easily slice, filter, map, and transform structured data.
- Official Documentation: jqlang.org
- Try jq Online: play.jqlang.org
Download the latest releases from the GitHub release page.
Pull the jq image to start quickly with Docker.
docker run --rm -i ghcr.io/jqlang/jq:latest < package.json '.version'docker run --rm -i -v "$PWD:$PWD" -w "$PWD" ghcr.io/jqlang/jq:latest '.version' package.json- libtool
- make
- automake
- autoconf
git submodule update --init # if building from git to get oniguruma
autoreconf -i # if building from git
./configure --with-oniguruma=builtin
make clean # if upgrading from a version previously built from source
make -j8
make check
sudo make installBuild a statically linked version:
make LDFLAGS=-all-staticIf you're not using the latest git version but instead building a released tarball (available on the release page), skip the autoreconf step, and flex or bison won't be needed.
A CMake build is also provided as an alternative to autoconf/automake. It
mirrors the same feature checks and produces the same jq executable,
libjq (shared and static) and libjq.pc outputs.
git submodule update --init # if building from git to get oniguruma
cmake -S . -B build -DJQ_BUILD_ONIGURUMA=builtin
cmake --build build -j
ctest --test-dir build --output-on-failure
sudo cmake --install buildUseful options (pass with -D<name>=<value>):
JQ_BUILD_ONIGURUMA—auto(default),system,builtin, oroffJQ_ENABLE_DECNUM— enable decNumber support (defaultON)JQ_ENABLE_ALL_STATIC— linkjqfully statically (defaultOFF)JQ_ENABLE_ASAN/JQ_ENABLE_UBSAN/JQ_ENABLE_GCOV— sanitizers and coverageJQ_BUILD_SHARED_LIB/JQ_BUILD_STATIC_LIB— choose whichlibjqflavors to buildJQ_BUILD_TESTS— register the test suite with CTest (defaultON)
For details on cross-compilation, check out the GitHub Actions file and the cross-compilation wiki page.
- Questions & Help: Stack Overflow (jq tag)
- Chat & Community: Join us on Discord
- Wiki & Advanced Topics: Explore the Wiki
jq is released under the MIT License. jq's documentation is
licensed under the Creative Commons CC BY 3.0.
jq uses parts of the open source C library "decNumber", which is distributed
under ICU License