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." # The SVG icon jqlang.org declares for itself. icon = "https://jqlang.org/icon.svg" executables = ["jq"] [dotfiles] # jq(1), MODULES: "The default search path is the search path given to the -L # command-line option, else ["~/.jq", "$ORIGIN/../lib/jq", "$ORIGIN/../lib"]", # and "If $HOME/.jq is a file, it is sourced into the main program." So the one # path is a file of definitions or a directory of modules, depending on what the # user put there — the same location either way. src/linker.c says it in code: # /* Import ~/.jq as a library named "" found in $HOME or %USERPROFILE% */, # which is why the Windows spelling resolves to this same ~/.jq. paths = ["~/.jq"] exclude = [] # jq definitions and modules. The tool holds no credential of its own, and # nothing else is written under this name. secret = [] # Read at the start of every invocation; no process keeps it open. side_effect = false # No machine_lines: what lands here is filters the user wrote, which is exactly # what should follow them to the next machine. [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"]