yq
Status
Section titled “Status”Version: 1.0.0 | Tests: Passing
{
"features": {
"ghcr.io/infrashift/trusted-devcontainer-features/yq:latest": {
"target_version": "4.45.4"
}
}
} Options
Section titled “Options”| Option | Type | Default | Description |
|---|---|---|---|
target_version | string | 4.45.4 | Select a supported yq version |
target_checksum | string | "" | SHA256 checksum for the yq binary |
Dependencies
Section titled “Dependencies”None — this feature is independent and has no dependencies.
How It Works
Section titled “How It Works”This feature downloads the yq binary from Mike Farah’s GitHub releases, specifically the yq_linux_amd64 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, optionally verifies the SHA256 checksum if one is provided via the target_checksum option. If no checksum is provided, the playbook downloads the checksums file from the GitHub release to perform verification. 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.