jq tool. Like jqplay for the commandline.
If you use macOS and Homebrew, you can install
brew install gpanders/tap/ijq
Select the version you want to download from sourcehut and download one of the precompiled releases from that page. Then extract the archive and copy the binary and, optionally, the man page to the correct location.
wget https://git.sr.ht/~gpanders/ijq/refs/vX.Y.Z/ijq-vX.Y.Z-linux-x86_64.tar.gz tar xf ijq-vX.Y.Z-linux-x86_64.tar.gz cd ijq-vX.Y.Z cp ijq /usr/local/bin mkdir -p /usr/local/share/man/man1 cp ijq.1 /usr/local/share/man/man1
Install go. To install
/usr/local/bin/ simply run
from the root of the project. To install to another location, set the
make prefix=~/.local install
To generate the man page you will also need to have scdoc installed.
ijq uses jq under the hood, so make sure you have that installed first.
Read from a file:
Read from stdin:
curl -s https://api.github.com/users/gpanders | ijq
Return to close
ijq and print the current filtered output to stdout.
This will also print the current filter to stderr. This allows you to save the
filter for re-use with
jq in the future:
ijq file.json 2>filter.jq # Same output as above jq -f filter.jq file.json
Shift plus the arrow keys to move between the different windows. When
either of the input or output views have focus, you can use the arrow keys to
scroll up and down. Vi keys also work, i.e. you can use
k to scroll up or
g to move to the top of the view,
G to jump to the bottom of the
Ctrl-B to scroll up or down a page at a time.
You can configure the colors by setting the
JQ_COLORS environment variable.
See the jq documentation for more details.