yq YAML Processor: Read, Edit, and Merge YAML Files From the CLI
Process YAML files with yq on the command line. Read, update, merge, and convert between YAML, JSON, and TOML using jq-compatible syntax.
Published:
Tags: developer-tools, cli, yaml
yq YAML Processor: Read, Edit, and Merge YAML Files From the CLI YAML is everywhere — Kubernetes manifests, GitHub Actions, Docker Compose, Helm charts, Ansible playbooks. Yet editing YAML from the command line without disturbing indentation or comments has always been painful. fixes this. This guide covers mikefarah/yq (v4), the Go-based rewrite that has become the de facto standard. Not to be confused with the older Python-based by kislyuk — the two have different syntax. Check which you have with . Updating Values In Place The flag edits the file in place, like : Without , yq outputs to stdout — useful for piping: --- Filtering and Selecting Use to filter arrays, just like jq: The function takes a regex: --- Multi-Document YAML Kubernetes files often contain multiple resources…
All articles · theproductguy.in