Difference between revisions of "Yq"

From Christoph's Personal Wiki
Jump to: navigation, search
(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...")
 
(No difference)

Latest revision as of 19:43, 28 September 2023

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