Loading...
Loading...
Command-line JSON processor. Extract, filter, transform JSON.
npx skill4agent add opendndapps/ogt-skills jqjq '[filter]' [file.json]
cat file.json | jq '[filter]'.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-r-c-s-Sjq '.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