v1.2.0

jq

Gustavo Madeira Santana Gustavo Madeira Santana ← All skills

Command-line JSON processor. Extract, filter, transform JSON.

Downloads
1.5k
Stars
2
Versions
3
Updated
2026-02-24

Install

npx clawhub@latest install jq

Documentation

jq

Command-line JSON processor for extracting, filtering, and transforming JSON.

Installation

macOS / Linux (Homebrew):
brew install jq
All platforms: See [jqlang.org/download](https://jqlang.org/download/) for packages, binaries, and build instructions.

Usage

jq '[filter]' [file.json]

cat file.json | jq '[filter]'

Quick Reference

.key                    # Get key

.a.b.c # Nested access

.[0] # First element

.[] # Iterate array

.[] | select(.x > 5) # Filter

{a: .x, b: .y} # Reshape

. + {new: "val"} # Add field

del(.key) # Remove field

length # Count

[.[] | .x] | add # Sum

keys # List keys

unique # Dedupe array

group_by(.x) # Group

Flags

-r raw output (no quotes) · -c compact · -s slurp into array · -S sort keys

Examples

jq '.users[].email' data.json          # Extract emails

jq -r '.name // "default"' data.json # With fallback

jq '.[] | select(.active)' data.json # Filter active

jq -s 'add' *.json # Merge files

jq '.' file.json # Pretty-print

Launch an agent with jq on Termo.