LinuxCommandLibrary

jql

TLDR

Query JSON

$ cat [data.json] | jql '".name"'
copy
Extract nested field
$ cat [data.json] | jql '".users[0].name"'
copy
Array operations
$ cat [data.json] | jql '".items|length"'
copy
Multiple queries
$ cat [data.json] | jql '".name" ".age"'
copy
Raw output
$ cat [data.json] | jql -r '".name"'
copy

SYNOPSIS

jql [options] selectors

DESCRIPTION

jql is a JSON query language tool written in Rust. It provides a simple syntax for extracting data from JSON.
The tool focuses on simplicity over jq's complexity. Queries use a straightforward dot notation.
jql extracts data from JSON.

PARAMETERS

SELECTORS

JQL query expressions.
-r, --raw-output
Raw string output.
-i FILE
Input file.
--help
Display help information.

CAVEATS

Different syntax from jq. Rust-based. Simpler but less powerful.

HISTORY

jql was created as a simpler alternative to jq with a more intuitive query syntax for common JSON operations.

SEE ALSO

jq(1), gron(1), fx(1)

Copied to clipboard