Skip to content

yq

Version: 1.6.0 | Tests: Passing

devcontainer.json
{
    "features": {
        "ghcr.io/infrashift/trusted-devcontainer-features/yq:latest": {
            "target_version": "4.54.1"
        }
    }
}
OptionTypeDefaultDescription
target_versionstring4.54.1Select a supported yq version
target_checksumstring""SHA256 checksum for the yq binary

None — this feature is independent and has no dependencies.

This feature downloads the yq binary from Mike Farah’s GitHub releases, specifically the yq_linux_<arch> artifact for the requested version. yq is a portable command-line processor for YAML, JSON, and XML that uses jq-like syntax, making it easy to query and manipulate structured data formats commonly used in DevOps and cloud-native workflows.

The Ansible playbook downloads the binary to ~/.local/bin/yq, verifies the SHA256 checksum against the pinned per-architecture digest, or against an explicit target_checksum if one is provided. (yq publishes its digests in a 20-column table whose algorithm order lives in a separate checksums_hashes_order file, so the digests are pinned in the role rather than parsed at install time.) Once verified, the executable bit is set and the installation is confirmed by running yq to check the installed version.

Like jq, yq is a standalone static binary with no external dependencies, so this feature has no dependency chain and installs quickly. It pairs naturally with the jq feature for comprehensive structured data processing across YAML, JSON, and XML formats in shell scripts and CI/CD pipelines.