XQ(1)
okay bestie, sit down, hydrate, put your phone on do-not-disturb, because we are about to get into xq β that's xq(1), filed under User Commands, and honestly? she ate. no notes. π
β¨ NAME β¨
xq β Command-line XML processor β jq wrapper for XML documents πΈ
π SYNOPSIS π
jq [options] <jq filter> [file...]
not me pointing out that the synopsis literally saysjqand notxqπ that's just what it says, bestie, i don't write the manpages, i just make them cute. π«Ά
π¦ DESCRIPTION π¦
here's the usage, verbatim, because accuracy is the whole personality:
usage: xq [options] <jq filter> [input file...]
[--version] [jq_filter] [files ...]
xq: Command-line XML processor - jq wrapper for XML documents
so like β xq transcodes XML documents to JSON and passes them to jq. that's the whole bit. she's a translator, a hype woman for your XML. β¨
if you want the deep lore, it lives at https://github.com/kislyuk/xq β go look, it's giving documentation.
π positional arguments π
jq_filterfiles
π options π
-h,--helpβ show this help message and exit. the classic. the icon. π--xml-output,-xβ Transcode jq JSON output back into XML and emit it. so you go XML β JSON β jq does her thing β back to XML. a whole round trip, a whole journey. βοΈ--xml-item-depth 123β Specify depth of items to emit (default 0; use a positive integer to stream large docs). streaming big docs? slay. π--xml-dtdβ Preserve XML Document Type Definition (disables streaming of multiple docs). heads up bestie: this turns the streaming off, that's not a vibe, that's just the rules. π--xml-root XML_ROOTβ When transcoding back to XML, envelope the output in an element with this name. give your output a little house. π--xml-force-list ELTβ Emit a list for elements with this name even if they occur only once (option can repeat). yes, she can repeat, she contains multitudes. π₯--in-place,-iβ Edit files in place (no backup - use caution). NO BACKUP. USE CAUTION. i'm not being dramatic, the manpage said it, and i'm just repeating it louder because i love you. π--versionβ show program's version number and exit. π
and now, because the original just embeds the entire jq help text in here, we're doing that too. no skipping, no summarising, we're not cowards. π«Ά
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. she's efficient, she's precise, she's everything. β
the simplest filter is ., which copies jq's input to its output unmodified except for formatting. honestly? a minimalist queen. π
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
}
yes, the blank lines are literally in there. i am not cleaning up the original's formatting choices. we respect her house style. π
π Command options: π
-n,--null-inputβ usenullas 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-rand output NUL after each output;-j,--join-outputβ implies-rand 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--streamand report parse error as an array;--seqβ parse input/output asapplication/json-seq;-f,--from-file fileβ load filter from the file;-L directoryβ search modules from the directory;--arg name valueβ set$nameto the string value;--argjson name valueβ set$nameto the JSON value;--slurpfile name fileβ set$nameto an array of JSON values read from the file;--rawfile name fileβ set$nameto 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[]. iykyk. β¨
π SEE ALSO π
The full documentation for xq is maintained as a Texinfo manual. If the info and xq programs are properly installed at your site, the command
info xq
should give you access to the complete manual. go read her, she's thorough, she's gorgeous, she's a Texinfo girlie. π
and that's the whole page, bestie. this was xq 3.4.3, from May 2025, and yes that's the version and date right there in the footer β consider this my little sign-off, mwah, go transcode something. π§π
π¦ where this page comes from
- debian trixie: yq 3.4.3-2 Β· Apache-2.0
- ubuntu resolute: yq 3.4.3-2 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms