mrkeyoor.com_
Sat 07 Nov 06:54 UTC
Dev Toolsevaluationupdated 25 Oct 2026

yq review

Mike Farah's yq is a Go command-line processor for querying, updating, merging and converting structured files. Its README documents YAML, JSON, XML, INI, properties, CSV, TSV, TOML and HCL support. It uses jq-like syntax, with incomplete jq compatibility and limits on preserving YAML presentation.

+17stars / 7d
Verdict

Consider Mike Farah's yq for targeted YAML queries, updates and conversions when jq-like syntax fits your scripts and output diffs are acceptable. Our 2026-10-10 run at a814ff5 recorded successful install-labelled and build-labelled steps, followed by a failing test command. The visible failure concerns malformed-JSON error wording, not unknown-extension detection. This record establishes neither an installed CLI nor broad workload correctness. Pin your chosen release and check representative inputs, optional fields and output layout before using it in automation.

We ran it

Lab card: what happened when we ran yqScreenshot of yq (mikefarah.gitbook.io/yq)
Install✓ · 35s56 packages
Build✓ · 49s
Tests✗ · 21s6 passed · 3 failed of 9 (go test)
Repo556 files~49,517 lines of source · 1.7 MB · 8 CI workflows · Dockerfile · tests dir

Answers from our run

Does yq build from source?

Dependencies installed in 35 seconds (56 packages), and the build succeeded in 49 seconds. We cloned commit a814ff5 into a clean Debian container with 3 CPUs and no project-specific setup.

Do yq's tests pass?

No. The project's own test command finished in 21 seconds and reported 6 passed, 3 failed (go test).

Who should not use yq?

Scripts requiring complete jq compatibility.

What are the alternatives to yq?

jq, kislyuk yq. Consider Mike Farah's yq for targeted YAML queries, updates and conversions when jq-like syntax fits your scripts and output diffs are acceptable.

Setup3/5The README documents platform binaries and several installation routes. Our 2026-10-10 a814ff5 run recorded successful setup steps, but no installed-binary check; packaging-specific constraints remain.
Docs4/5The supplied README contains query, update, merge, conversion and installation examples, and the operator index covers many operations. We did not independently validate the full documentation.
Community2/5The supplied issues contain reports and technical follow-up, and the release page credits a contributor. This limited evidence does not measure adoption, support responsiveness or community health.
Maturity3/5The README documents a broad v4 feature set and explicit limitations. Our dated test command failed with a visible diagnostic assertion mismatch; exhaustive coverage and workload correctness remain unverified.

Discussed on

  1. hnyq: command-line YAML, JSON, XML, CSV and properties processor224 points
  2. hnYq is a portable command-line YAML processor6 points
  3. hnYq: A portable command-line YAML processor5 points
  4. hnYq – a lightweight and portable command-line YAML, JSON and XML processor4 points

Who it’s for

Developers and operators making targeted YAML changes in shell scripts and CI.
Maintainers who want documented queries, merges and format conversions in one CLI.
jq users willing to check expression behavior against yq's documentation.
Teams that can review output diffs and maintain representative configuration fixtures.

Who it’s NOT for

Scripts requiring complete jq compatibility.
Workflows requiring byte-for-byte preservation of YAML comments, whitespace and scalar layout.
Snap workflows requiring direct access to root files without a privileged piping and write-back arrangement.
Users expecting timezone operations in the stock Alpine container without adding timezone data.
Teams treating a successful setup step or parser-generated test summary as proof of an installed, fully verified CLI.

Setup reality

In our recorded run on 2026-10-10 at commit a814ff5, the install-labelled step exited 0 after 35 seconds, the build-labelled step exited 0 after 49 seconds, and the test command exited 1 after 21 seconds. The dependency summary recorded 56 packages. These are rounded step durations, not measured configuration-editing workloads.

The install tail shows a Go 1.26.0 toolchain download. The build tail contains vet-exit:0; the supplied record does not show an installed-binary version check or an end-to-end CLI workload. Step success therefore does not establish that a usable CLI was installed.

The README documents dependency-free platform binaries, package managers, Go installation, Docker and Podman. It distinguishes community-supported packages, which may lag official releases. Snap confinement, container file permissions, missing Alpine timezone data and Podman's SELinux volume labeling need attention for the relevant installation route.

A YAML editing CLI with two boundaries to check

Mike Farah's yq puts YAML queries and updates into shell commands, but jq compatibility and exact formatting preservation both have limits. Those limits matter when a short expression becomes part of a deployment pipeline.

The README documents reading .a.b[0].c, updating files in place, selecting array items, merging documents and using environment variables. It also lists conversions involving JSON, XML, HCL, TOML, properties, CSV and TSV, alongside INI support. These are documented capabilities; our recorded run did not exercise a conversion matrix or measure editing workloads.

The project is written in Go, and its README offers dependency-free platform binaries. That makes it a candidate for shell automation without a separate language runtime. It does not make every packaging route equivalent.

What our recorded run establishes

Our stored sandbox run began on 2026-10-10 at 03:38:29 UTC against commit a814ff5 (a814ff5166040ec745a96bddd79ee31c3a548e83). The recorded configuration was 3 CPUs, 8 GB of memory and image golang:1.24-bookworm. The image label alone does not establish the runtime used: the install tail shows a Go 1.26.0 toolchain download.

The install-labelled step exited 0 after 35 seconds, and the dependency summary recorded 56 packages. The build-labelled step exited 0 after 49 seconds, with vet-exit:0 in its retained tail. We do not have the complete command transcript, an installed-binary check or a measured CLI workload. These observations support successful recorded steps, not a claim that we installed and exercised the executable.

The test command exited 1 after 21 seconds. Its parser summary records 6 passing and 3 failing results out of 9, but those figures are not verified unique test or package counts. The retained tail repeats summary lines. Its distinct visible package results show the main module, cmd and test passing, with pkg/yqlib failing.

The visible failure is TestJSONScenarios, in a malformed-JSON case. The expected diagnostic contains json: string of object unexpected end of JSON input; the actual diagnostic contains invalid character 'b' after object key:value pair. This is evidence of an error-message assertion mismatch. The partial log does not establish the cause of every recorded failure or prove that valid JSON processing is broken. File-closing errors and interpolation and merge-anchor warnings also appear in the tail; their broader effect was not investigated in this run.

The checkout summary recorded 556 files, approximately 49,517 source lines, 1.7 MB, 8 CI workflows, a Dockerfile and a tests directory. No new execution, security audit or complete-log reconciliation was performed for this correction.

Specify formats when automatic detection is unsuitable

The README explicitly says that unknown filename extensions and standard input default to YAML. That is documented behavior, rather than an unknown-extension defect established by our run.

For ambiguous input, select the format explicitly. The existing examples -p yaml and -p xml express that choice. Use the same approach in automation when a filename or pipe does not communicate the format reliably.

Check jq assumptions and YAML layout separately

The README states that yq does not support everything jq does. The operator index is a useful starting point for checking the operations a script needs.

Issue 2782 reports different missing-key collection behavior inside select, and and or in version 4.53.3. This is an upstream report, not something reproduced in our run. For configuration conditions, include absent keys, explicit nulls and false values in your fixtures rather than assuming jq behavior transfers unchanged.

Formatting needs a separate check. The README says yq attempts to preserve comments and whitespace but cannot handle every scenario. Review diffs before committing in-place edits.

Issue 2819, reported for versions 4.53.2 and 4.53.3, concerns the output layout of a single-quoted multiline scalar after yq .. A later commenter reports checks against commit ef305ad showing the same scalar value and successful parsing despite the changed layout. Those checks belong to the issue contributor. They support treating that example as a presentation problem, rather than evidence of value corruption, and do not establish behavior at our measured commit.

Issue 2797 separately reports multiline output being emitted as a quoted line with escaped newlines for some UTF-8 characters in version 4.53.3. We did not reproduce that report or verify its status in a selected release.

Choose the installation route deliberately

The README documents strict snap confinement and a privileged piping and write-back arrangement for root files. Its container image runs without root privileges, so mounted-file permissions can affect reads and in-place edits. The Alpine image omits timezone data; the documented adjustment for the tz operator adds tzdata. Podman with SELinux requires the :z shared-volume flag in the documented mount example.

These are documented packaging constraints. Our sandbox did not test snap, container permissions, timezone operations or SELinux behavior.

The supplied v4.53.6 release page identifies commit c14f446 and lists a release-build fix, a line-wrapping fix and dependency updates. It is a release reference, not the commit used in our run, and the supplied evidence does not establish that it is the latest release.

Which tool fits the job?

jq describes itself as a command-line JSON processor. Choose it for JSON input when you want jq itself to evaluate the expression.

kislyuk yq converts YAML to JSON and pipes it to jq, which must also be installed. Its -Y mode carries formatting metadata through that representation; its documentation warns that this can change filter results, including array counts. Choose it when the jq engine is a requirement and you can accommodate that conversion model.

For Mike Farah's yq, the useful next step is a small fixture set using your pinned version: check extracted values, conditional selection, conversions you actually need and the diff from an in-place edit. Our recorded command results do not replace those checks.

How to read the ratings

The ratings are editorial assessments of the supplied evidence, not benchmark results. On this five-point rubric, 1 means substantial documented obstacles, 2 means limited supporting evidence, 3 means a documented practical route with unresolved verification, 4 means broad supporting documentation with clear limits, and 5 requires broad independent verification. Community ratings describe the evidence available here, not a measured adoption level.

Alternatives

ProjectWhat it isPick it when
jq gh↗A command-line JSON processor written in portable C with zero runtime dependencies.Choose jq when the input is JSON and you want to run jq expressions directly.
kislyuk yqA YAML-to-JSON wrapper that pipes data to jq, with XML and TOML processing also documented.Choose it when you want jq to evaluate filters over converted YAML and can install its jq dependency. Check filters carefully when using its formatting-preservation mode.

What people are saying

  1. [github-trending] mikefarah/yq

Sources

  1. yq README
  2. yq operator documentation
  3. yq 4.53.6 release
  4. Missing-key selection issue 2782
  5. UTF-8 multiline output issue 2797
  6. Single-quoted multiline indentation issue 2819

More dev tools reviews

git-cliff · blackbird · czkawka · controller-runtime · openchoreo · terraform-provider-azurerm · the whole board →