YQ(1)

πŸ“¦
version 3.4.3 Β· 3 versions
, in debian trixie, ubuntu resolute

hiii bestie πŸ’– welcome to the manual page for yq, which lives in the User Commands section of the manual β€” that's why the header up top says YQ(1), and now you know, iykyk ✨


πŸŽ€ NAME πŸŽ€

yq β€” Command-line YAML processor - jq wrapper for YAML documents πŸ¦‹


🌸 SYNOPSIS 🌸

jq [options] <jq filter> [file...]

πŸ’… DESCRIPTION πŸ’…

okay so here's the usage, verbatim, no cap:

usage: yq [options] <jq filter> [input file...]

       [--indentless-lists] [--explicit-start] [--explicit-end]
       [--in-place] [--version] [jq_filter] [files ...]

yq: Command-line YAML processor - jq wrapper for YAML documents πŸ‘‘

so like. yq transcodes YAML documents to JSON and passes them to jq. literally that's the whole vibe. See https://github.com/kislyuk/yq for more information 🫢

✨ positional arguments: ✨

  • jq_filter
  • files

πŸ“ options: πŸ“

  • -h, --help β€” show this help message and exit πŸ™ˆ
  • --yaml-output, --yml-output, -y β€” Transcode jq JSON output back into YAML and emit it πŸ’«
  • --yaml-roundtrip, --yml-roundtrip, -Y β€” Transcode jq JSON output back into YAML and emit it. Preserve YAML tags and styles by representing them as extra items in their enclosing mappings and sequences while in JSON. This option is incompatible with jq filters that do not expect these extra items ⚠️
  • --yaml-output-grammar-version, --yml-out-ver {1.1,1.2} β€” When using --yaml-output, specify output grammar (the default is 1.1 and will be changed to 1.2 in a future version). Setting this to 1.2 will cause strings like 'on' and 'no' to be emitted unquoted πŸ‘€
  • --width, -w WIDTH β€” When using --yaml-output, specify string wrap width πŸ“
  • --indentless-lists, --indentless β€” When using --yaml-output, indent block style lists (sequences) with 0 spaces instead of 2 🌈
  • --explicit-start β€” When using --yaml-output, always emit explicit document start ("---") 🚩
  • --explicit-end β€” When using --yaml-output, always emit explicit document end ("...") 🏁
  • --in-place, -i β€” Edit files in place (no backup - use caution) 😭
  • --version β€” show program's version number and exit πŸ’œ

🌟 jq - commandline JSON processor [version 1.7] 🌟

jq [options] --args <jq filter> [strings...]  jq [options]
--jsonargs <jq filter> [JSON_TEXTS...]

jq is a tool for processing JSON inputs, applying the given filter to its JSON text inputs and producing the filter's results as JSON on standard output ✨

The simplest filter is ., which copies jq's input to its output unmodified except for formatting. For more advanced filters see the jq(1) manpage ("man jq") and/or https://jqlang.github.io/jq/ πŸ“š

Example:

$ echo '{"foo": 0}' | jq .

{

"foo": 0

}

πŸ‘‘ Command options: πŸ‘‘

  • -n, --null-input β€” use null as the single input value;
  • -R, --raw-input β€” read each line as string instead of JSON;
  • -s, --slurp β€” read all inputs into an array and use it as the single input value;
  • -c, --compact-output β€” compact instead of pretty-printed output;
  • -r, --raw-output β€” output strings without escapes and quotes;
  • --raw-output0 β€” implies -r and output NUL after each output;
  • -j, --join-output β€” implies -r and output without newline after each output;
  • -a, --ascii-output β€” output strings by only ASCII characters using escape sequences;
  • -S, --sort-keys β€” sort keys of each object on output;
  • -C, --color-output β€” colorize JSON output;
  • -M, --monochrome-output β€” disable colored output;
  • --tab β€” use tabs for indentation;
  • --indent n β€” use n spaces for indentation (max 7 spaces);
  • --unbuffered β€” flush output stream after each output;
  • --stream β€” parse the input value in streaming fashion;
  • --stream-errors β€” implies --stream and report parse error as an array;
  • --seq β€” parse input/output as application/json-seq;
  • -f, --from-file file β€” load filter from the file;
  • -L directory β€” search modules from the directory;
  • --arg name value β€” set $name to the string value;
  • --argjson name value β€” set $name to the JSON value;
  • --slurpfile name file β€” set $name to an array of JSON values read from the file;
  • --rawfile name file β€” set $name to string contents of file;
  • --args β€” consume remaining arguments as positional string values;
  • --jsonargs β€” consume remaining arguments as positional JSON values;
  • -e, --exit-status β€” set exit status code based on the output;
  • -V, --version β€” show the version;
  • --build-configuration β€” show jq's build configuration;
  • -h, --help β€” show the help;
  • -- β€” terminates argument processing;

Named arguments are also available as $ARGS.named[], while positional arguments are available as $ARGS.positional[] πŸ’–


πŸ¦‹ SEE ALSO πŸ¦‹

The full documentation for yq is maintained as a Texinfo manual. If the info and yq programs are properly installed at your site, the command

info yq

should give you access to the complete manual πŸ“–βœ¨


and that's the whole page, bestie 🫢 go forth and process ur YAML πŸ’…

this was yq 3.4.3, dated May 2025, brought to you by the YQ(1) girlies πŸ’œπŸŒΈ

πŸ“¦ where this page comes from