A portable command-line YAML processor. Process YAML, JSON, XML, CSV and properties files.
yq is a lightweight and portable command-line processor for YAML, JSON, XML, INI, properties, CSV, and TSV files. It uses jq-like syntax but extends support beyond JSON to work with multiple structured data formats. Written in Go, yq provides a dependency-free binary that can be easily downloaded and run on any platform without additional dependencies.
The tool excels at reading, updating, and transforming structured data files with powerful query capabilities. Users can perform operations like extracting specific values, updating files in-place, merging multiple files, converting between different formats (YAML to JSON, XML to YAML, etc.), and manipulating complex nested data structures. It supports advanced features like environment variable substitution, array filtering, and preserving YAML formatting and comments during updates.
yq is ideal for DevOps engineers, system administrators, and developers who work with configuration files, CI/CD pipelines, and data transformation tasks. It's particularly valuable for those managing Kubernetes manifests, Docker Compose files, GitHub Actions workflows, and other YAML-heavy environments where quick, reliable data manipulation is essential.
# via Homebrew
brew install yq
# via Go Install
go install github.com/mikefarah/yq/v4@latest
# via Binary Download
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/local/bin/yq && chmod +x /usr/local/bin/yq