Welcome to jonq’s documentation!¶
jonq is a command-line JSON tool for exploring, extracting, and reshaping payloads with readable jq-powered queries. It keeps familiar select / if syntax for common cases, accepts where as a filter alias, and stays focused on JSON-native terminal workflows.
Important
jonq is not a database, ETL system, or full jq replacement. Use it to understand and shape JSON quickly from the shell.
Key Features¶
Readable jq syntax:
select name, age if age > 30DISTINCT, LIMIT, IN, NOT, LIKE, IS NULL operators
CASE/WHEN: conditional expressions inline
COALESCE: null fallback with nested function support
String concat:
||or+for concatenationString functions:
upper,lower,length,trimMath functions:
round,abs,ceil,floorType casting:
int,float,str,typeDate/time:
todate,fromdate,dateAggregations:
sum,avg,min,max,count,count(distinct ...)GROUP BY with HAVING
Table output:
-tfor aligned terminal tablesJSONL / YAML output:
--format jsonland--format yamlRaw scalar output:
-rfor unquoted values in shell pipelinesSmart Inspect: run
jonq data.jsonto see fields, samples, and suggested queriesProfile:
jonq profile data.jsonfor field presence, nulls, missing counts, and type conflictsDiff:
jonq diff old.json new.jsonto catch shape driftChecks:
jonq checkwith inline assertions or named checks fromjonq.yamlNamed queries:
jonq run NAMEfromjonq.yamlInteractive REPL:
jonq -i data.jsonwith tab completion and historyFollow mode:
--followto stream NDJSON line-by-lineStreaming mode:
--streamfor row-wise root-array queriesWatch mode:
--watchto re-run on file changeMultiple inputs: local files, URLs, globs, stdin (auto-detected), NDJSON
Shell completions:
--completions bash|zsh|fishExplain mode:
--explainto see query breakdown and jq filterFuzzy suggestions: typo correction for field names
Colorized output: syntax-highlighted JSON in terminal
Contents:
- Installation
- Usage
- Overview
- Query Syntax Breakdown
- Field Selection
- FROM Clause
- Filtering with Conditions
- Sorting and Limiting
- Aggregation Functions
- Grouping Data
- Having Clause
- Output Formats
- Smart Inspect
- Profile, Diff, And Check
- Interactive REPL
- Watch Mode
- Multiple Input Sources
- Follow Mode
- Shell Completions
- Auto-detect NDJSON
- Query Repair Suggestions
- Colorized Output
- Handling Large Files
- Tips and Tricks
- Known Limitations
- Usage in Python
- Cookbook
- Comparison
- Examples
- API Reference
- Contributing