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
- Official Documentation: jqlang.org
- Try jq Online: play.jqlang.org
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
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
docker run --rm -i -v "$PWD:$PWD" -w "$PWD" ghcr.io/jqlang/jq:latest '.version' package.jsonBuilding from source
Dependencies
- libtool
- make
- automake
- autoconf
Instructions
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.
Cross-Compilation
For details on cross-compilation, check out the GitHub Actions file and the cross-compilation wiki page.
Community & Support
- Questions & Help: Stack Overflow (jq tag)
- Chat & Community: Join us on Discord
- Wiki & Advanced Topics: Explore the Wiki
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:
pip install pipenvThough, you may need to say pip3 instead, depending on your system. Once
you have pipenv installed, you can install the dependencies by runningpipenv 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 runmake 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.