LinuxCommandLibrary

oq

Portable jq wrapper with XML and YAML support

TLDR

Query JSON (same as jq)
$ oq '.[0]' [file.json]
copy
Convert YAML to JSON
$ oq -i yaml '.' [file.yaml]
copy
Query XML and output as YAML
$ oq -i xml -o yaml '.root.element' [file.xml]
copy

SYNOPSIS

oq [options] filter [file]

DESCRIPTION

oq is a performant, portable jq wrapper that adds support for consuming and outputting formats beyond JSON, including XML and YAML. All jq filters work as expected — oq handles format conversion on input and output transparently.

PARAMETERS

-i FORMAT

Input format (json, yaml, xml). Default: json.
-o FORMAT
Output format (json, yaml, xml). Default: json.

CAVEATS

Requires jq to be installed. XML-to-JSON conversion follows specific mapping rules that may not preserve all XML semantics.

HISTORY

oq was created by Blacksmoke16 and is written in Crystal.

SEE ALSO

jq(1), yq(1), xq(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard