yq
YAML processor.
yq is a command‑line tool that lets users process YAML, XML, and TOML files by converting them to JSON and piping the result through jq. It supports standard jq filters and can read from stdin or file arguments, preserving key order by default. An optional `-y` flag re‑encodes jq output back into YAML, while `-Y` enables a round‑trip mode that retains custom YAML tags and styles by embedding metadata in the intermediate JSON.
The utility can also be invoked as a Python module, allowing in‑place editing of files with options such as `--indentless` and `--in-place`. Additional flags control line‑wrap width, explicit document markers, and forward any other jq arguments unchanged. Exit codes follow jq unless a YAML parsing error occurs.
yq is suitable for developers and system administrators who need to query, transform, or convert configuration files in YAML, XML, or TOML formats while optionally maintaining original formatting details. It is distributed via pip and, on macOS, through Homebrew.
Reviews
Loading reviews…