Yq

From Christoph's Personal Wiki
Revision as of 19:43, 28 September 2023 by Christoph (Talk | contribs) (Created page with "'''yq''' is a lightweight and portable command-line YAML, JSON and XML processor. yq uses jq like syntax but works with YAML files as well as JSON, XML, properties, csv an...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

yq is a lightweight and portable command-line YAML, JSON and XML processor. yq uses jq like syntax but works with YAML files as well as JSON, XML, properties, csv and tsv.

Examples

$ yq -i '.spec.replicas=1' deployment/nginx/deploy.yml
$ yq -i '.spec.template.spec.containers[0].ports[0].containerPort=8080' deployment/nginx/deploy.yml
$ yq -i 'del(.resources[2])' deployment/nginx/kustomization.yml

External links