Skip to content

jq

Installs jq, the lightweight command-line JSON processor, either as a pre-built binary from GitHub Releases or compiled from source with a built-in Oniguruma regex library.

Terminal window
zi for \
from'gh-r' \
sbin'* -> jq' \
nocompile \
@jqlang/jq
Terminal window
zinit for \
configure'--with-oniguruma=builtin' \
make \
jqlang/jq
  • from'gh-r' — downloads the release asset from GitHub Releases.
  • sbin'* -> jq' — creates a shim named jq pointing to the downloaded binary (requires zinit-annex-bin-gem-node).
  • nocompile — skips Zinit’s Zsh compilation step (not applicable to a binary).
  • configure'--with-oniguruma=builtin' — runs ./configure --prefix=$ZPFX --with-oniguruma=builtin, bundling the Oniguruma regex library so no system dependency is needed.
  • make — builds and installs jq into $ZPFX.

For the binary variant, zinit-annex-bin-gem-node must be loaded first. The compile-from-source variant requires standard build tools (gcc/clang, make, autoconf).

Terminal window
# Binary variant (fast, no compilation)
# prerequisite — load once at the top of .zshrc
zinit light-mode for zdharma-continuum/zinit-annex-bin-gem-node
zi for \
from'gh-r' \
sbin'* -> jq' \
nocompile \
@jqlang/jq
# OR: compile from source
zinit for \
configure'--with-oniguruma=builtin' \
make \
jqlang/jq