| name | jq-lite |
| description | Pipe JSON into a query CLI with intuitive dot-notation syntax. Use when you need to extract fields from JSON, filter arrays, transform objects, or format JSON output. Triggers include "query JSON", "extract from JSON", "filter JSON array", "jq", "process JSON in shell", "parse API response", or any task involving JSON data manipulation in the terminal. |
jq-lite (jql)
Pipe any JSON into jql and extract, filter, or transform with dot-notation queries.
Quick Start
echo '{"name":"Alice","age":30}' | jql '.name'
curl -s https://api.example.com/users | jql '.users[] | select(.active) | .email'
Common Patterns
jql '.name' < data.json
jql '.users[0].email' < users.json
jql '.users[].name' < users.json
jql '.users[] | select(.active == true)' < users.json
jql '.users | map(.name)' < users.json
jql '.items | sort_by(.price) | .[0:5]' < items.json
jql '.users | length' < users.json
jql 'keys' < config.json
jql '.orders | group_by(.status) | map({status: .[0].status, count: length})' < orders.json
Output Formats
jql '.users'
jql -c '.users'
jql -r '.name'
jql --csv '.users'
jql --tsv '.users'
jql --yaml '.config'
jql --no-color '.'
Built-in Functions
| Function | Description |
|---|
keys | Sorted array of object keys |
values | Array of object values |
length | Array/string/object size |
type | JSON type as string |
has(key) | Boolean: has property |
map(expr) | Apply to each array element |
select(expr) | Keep if expression is true |
sort_by(f) | Sort by expression |
group_by(f) | Group by expression |
unique | Unique values |
flatten | Flatten nested arrays |
to_entries | [{key, value}] from object |
from_entries | Object from [{key, value}] |
add | Sum numbers or join strings/arrays |
min, max | Array minimum/maximum |
first, last | First/last element |
test(regex) | Boolean regex match |
ascii_downcase | Lowercase string |
split(s) | Split string |
join(s) | Join array |
NDJSON Streaming
cat events.ndjson | jql 'select(.type == "error") | .user'
cat events.ndjson | jql -s 'length'
Environment Variables
| Variable | Description | Default |
|---|
JQL_NO_COLOR | Disable color (0 or 1) | 0 |
JQL_COMPACT | Always compact (0 or 1) | 0 |
JQL_RAW | Always raw output (0 or 1) | 0 |