Gem

jq

Slice, filter and reshape JSON on the command line.

Would you recommend jq?

No votes yet. Tried it? Be the first to say.

One vote per person. No account needed.

Overview

jq is a small language for JSON, run as a single binary. Pipe an API response or a config file into it and pull out a field, filter an array, rename keys or build a new document. It's the standard way to handle JSON in shell scripts and CI jobs, and other tools copy its filter syntax.

Instead of
Ad-hoc Python or Node scripts, and grep/sed on JSON (which breaks as soon as the formatting changes)
Reach for it when
You're scripting against a JSON API, reading cloud CLI output, or need one value from a large JSON file in CI.

Try it in a few minutes

Terminal
brew install jq   # or: winget install jqlang.jq / apt install jq
curl -s https://api.github.com/repos/jqlang/jq | jq '{name, stars: .stargazers_count}'
echo '[{"n":1},{"n":5}]' | jq 'map(select(.n > 2))'

Related tools

Other tools that share topics with jq.

Starship

starship.rs
Gem

A fast, cross-shell prompt that shows your git status, language versions and more.

Instead of Oh My Zsh themes, Powerlevel10k, and hand-written PS1 strings

direnv

direnv.net
Gem

Load and unload environment variables automatically when you cd into a project.

Instead of Manually sourcing .env files, exports in ~/.bashrc

jless

jless.io
Gem

A terminal JSON viewer: collapse and expand nodes, move with vim keys, search with regex.

Instead of `cat response.json | jq . | less`, and opening a 40 MB JSON file in your editor just to look at it