id = "jq"
name = "jq"
homepage = "https://jqlang.org"
description = "jq is a lightweight and flexible command-line JSON processor akin to sed, awk, grep, and friends for JSON data."
icon = "https://jqlang.org/icon.svg"
executables = ["jq"]
[dotfiles]
paths = ["~/.jq"]
exclude = []
secret = []
side_effect = false
[commands]
format = 1
label = "Filter JSON"
description = "Run a jq filter over JSON files or standard input. Streaming, module paths, variable binding and test running are left out."
quality = "ai-draft"
base = "fig:jq"
parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = true }
[[commands.source]]
id = "fig"
kind = "completion"
url = "https://github.com/withfig/autocomplete/blob/master/src/jq.ts"
license = "MIT"
[[commands.field]]
id = "filter"
label = "Filter"
description = "The jq program, for example .items[].name. Quote it for the shell."
type = "string"
position = 0
sources = ["fig"]
[[commands.field]]
id = "files"
label = "Input files"
description = "Leave empty to read standard input."
type = "path"
position = 1
multiple = true
path = { kind = "file", role = "input", must_exist = true }
sources = ["fig"]
[[commands.field]]
id = "raw_output"
label = "Raw strings"
description = "Print string results without JSON quotes."
type = "boolean"
option = ["--raw-output", "-r"]
sources = ["fig"]
[[commands.field]]
id = "compact"
label = "Compact output"
description = "One JSON value per line instead of pretty-printing."
type = "boolean"
option = ["--compact-output", "-c"]
sources = ["fig"]
[[commands.field]]
id = "slurp"
label = "Slurp into array"
description = "Read all inputs into one array and run the filter once."
type = "boolean"
option = ["--slurp", "-s"]
sources = ["fig"]
[[commands.field]]
id = "null_input"
label = "Null input"
description = "Do not read any input; run the filter once with null."
type = "boolean"
option = ["--null-input", "-n"]
sources = ["fig"]
[[commands.field]]
id = "raw_input"
label = "Raw text input"
description = "Treat each input line as a string instead of parsing JSON."
type = "boolean"
option = ["--raw-input", "-R"]
sources = ["fig"]
[[commands.field]]
id = "sort_keys"
label = "Sort keys"
type = "boolean"
option = ["--sort-keys", "-S"]
sources = ["fig"]
[[commands.field]]
id = "tab"
label = "Indent with tabs"
type = "boolean"
option = ["--tab"]
sources = ["fig"]
[[commands.field]]
id = "color"
label = "Force color"
type = "boolean"
option = ["--color-output", "-C"]
sources = ["fig"]
[[commands.field]]
id = "exit_status"
label = "Exit status from result"
description = "Exit non-zero when the last output is false or null."
type = "boolean"
option = ["--exit-status", "-e"]
sources = ["fig"]
[[commands.task]]
id = "pretty"
label = "Query JSON files"
fields = ["filter", "files", "raw_output", "sort_keys"]
required = ["filter"]
[[commands.task]]
id = "compact-lines"
label = "Compact one value per line"
set = { compact = [true] }
fields = ["filter", "files", "compact", "raw_output"]
required = ["filter"]
[[commands.group]]
id = "basic"
label = "Basic"
fields = ["filter", "files", "raw_output", "compact", "slurp", "null_input"]
[[commands.group]]
id = "advanced"
label = "Advanced"
fields = ["raw_input", "sort_keys", "tab", "color", "exit_status"]