// the find
mikefarah/yq
yq is a portable command-line YAML, JSON, XML, CSV, TOML, HCL and properties processor
yq is a command-line processor for YAML, JSON, XML, CSV, TOML, HCL, INI, and properties files, using jq-like syntax. It ships as a single static binary with no dependencies, making it a practical choice for CI pipelines, shell scripts, and config automation. The target audience is anyone who needs to query or transform structured config files without writing a full script.
Single static Go binary — drop it into a Docker layer or CI runner with one wget and you're done, no runtime dependencies to break. Format coverage is genuinely broad: YAML ↔ JSON ↔ XML ↔ TOML ↔ HCL in one tool means you can stop juggling five different converters in your pipeline. The jq-like expression language handles in-place edits, multi-document YAML, anchors/aliases, and comment preservation, which most alternatives don't touch. Active maintenance (last push yesterday) with a large test suite covering each operator separately — the acceptance test suite in shell scripts catches real-world regressions well.
Comment preservation is best-effort and will silently mangle whitespace in complex cases — the README admits this and the upstream go-yaml issue has been open for years, which means you can't safely round-trip YAML through yq in a formatter-enforced repo. The jq compatibility claim is aspirational, not complete; anyone who knows jq well will hit missing functions and subtle behavioral differences that aren't documented inline — you'll find out at 2am. XML support maps attributes to prefixed keys (+@attr), which works but produces awkward expressions and isn't interoperable with standard XPath thinking. The GitHub Action points at @master rather than a pinned SHA, which is a supply-chain risk in security-conscious pipelines.