jq Documentation

Command-line JSON processor

35,440 stars C C 1 file ยท ~886 tokens #jq
RAW Doc

Docker & Self-Hosted Deployment Verified OCI

Deploy jq on any server, homelab, or cloud container platform.

1-Click Terminal Command
bash (docker run)
docker run -d --name jq --restart always jqlang/jq:latest

File: README.md

jq

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.

Documentation

Installation

Prebuilt Binaries

Download the latest releases from the GitHub release page.

Docker Image

Pull the jq image to start quickly with Docker.

Run with Docker

Example: Extracting the version from a `package.json` file

bash
docker run --rm -i ghcr.io/jqlang/jq:latest < package.json '.version'

Example: Extracting the version from a `package.json` file with a mounted volume

bash
docker run --rm -i -v "$PWD:$PWD" -w "$PWD" ghcr.io/jqlang/jq:latest '.version' package.json

Building from source

Dependencies

  • libtool
  • make
  • automake
  • autoconf

Instructions

console
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 install

Build a statically linked version:

console
make LDFLAGS=-all-static

If 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.

Cross-Compilation

For details on cross-compilation, check out the GitHub Actions file and the cross-compilation wiki page.

Community & Support

License

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


File: docs/README.md

Documentation

The jq website, manpages and some of the tests are generated from this
directory. The manual is a YAML file in content/manual.

To build the documentation (including building the jq manpage), you'll
need python3 and pipenv. You can install pipenv like so:

text
pip install pipenv

Though, you may need to say pip3 instead, depending on your system. Once
you have pipenv installed, you can install the dependencies by running
pipenv sync from the docs/ directory.

Also, you may need to run virtualenv -p /usr/bin/python3 venv/ and
then source venv/bin/activate, and only then pipenv sync.

Once this is done, rerun ./configure --enable-docs in the jq root directory and then
the Makefile will be able to generate the jq manpage. You can just run
make jq.1 to build the manpage manually, and make tests/man.test to
update the manual tests.

To build the website, run pipenv run python3 build_website.py in the docs/ directory.
To serve them locally, you can run python3 -m http.server -d output.