All apps/jq

jq

jq

jq is a lightweight and flexible command-line JSON processor akin to sed, awk, grep, and friends for JSON data.

Runs as jq|macOS, Linux, Windows|jqlang.org

Autocomplete

Fig spec, with what the manifest adds · 26 options
Published once and never changed; check the digest before caching
sha256
829287f7c7f95873950abf43a93216bd5dc750b2f48f169da604c4f146b5ccde
Size
6061 bytes
OptionsOn jq itself
--version
Output the jq version and exit with zero
--seq
Use the application/json-seq MIME type scheme for separating JSON texts in jq's input and output
--stream
Parse the input in streaming fashion, outputting arrays of path and leaf values
--slurp-s
Instead of running the filter for each JSON object in the input, read the entire input stream into a large array and run the filter just once
--raw-input-R
Don't parse the input as JSON. Instead, each line of text is passed to the filter as a string
--null-input-n
Don't read any input at all! Instead, the filter is run once using null as the input
--compact-output-c
By default, jq pretty-prints JSON output. Using this option will result in more compact output by instead putting each JSON object on a single line
--tab
Use a tab for each indentation level instead of two spaces
--indent
Use the given number of spaces for indentation <n>
--color-output-C
By default, jq outputs colored JSON if writing to a terminal. You can force it to produce color even if writing to a pipe or a file using -C
--monochrome-output-M
Disable color
--ascii-output-a
Jq usually outputs non-ASCII Unicode codepoints as UTF-8, even if the input specified them as escape sequences
--unbuffered
Flush the output after each JSON object is printed
--sort-keys-S
Output the fields of each object with the keys in sorted orde
--raw-output-r
If the filter's result is a string then it will be written directly to standard output rather than being formatted as a JSON string with quotes
--join-output-j
Like -r but jq won't print a newline after each output
-f--from-file
Read filter from the file rather than from a command line <filename>
-L
Prepend directory to the search list for modules <directory>
-e--exit-status
Sets the exit status of jq to 0 if the last output values was neither false nor null, 1 if the last output value was either false or null, or 4 if no valid result was ever produced
--arg
This option passes a value to the jq program as a predefined variable <name> <value>
--argjson
This option passes a JSON-encoded value to the jq program as a predefined variable <name> <JSON-text>
--slurpfile
This option reads all the JSON texts in the named file and binds an array of the parsed JSON values to the given global variable <variable name> <filename>
--rawfile
This option reads in the named file and binds its contents to the given global variable <variable name> <filename>
--args
Remaining arguments are positional string arguments. These are available to the jq program as $ARGS.positional[]
--jsonargs
Remaining arguments are positional JSON text arguments. These are available to the jq program as $ARGS.positional[]
--run-tests
Runs the tests in the given file or standard input. This must be the last option given and does not honor all preceding options <filename>
ArgumentsPositional, in order
<filter>
Must be enclosed in single quotes
<files>
· optional · repeatable · filepaths