yq

Parse, filter, and transform YAML, JSON, XML, CSV from the command line.

brewmacoslinux
Try with needOr install directly
Source

About

Process YAML, JSON, XML, CSV and properties documents from the CLI

Commands

yq

Examples

pretty print JSON or YAML to make it readable$ yq '.' file.json
extract a specific value from a YAML file$ yq '.spec.replicas' deployment.yaml
convert YAML to JSON format$ yq -o json file.yaml
update or modify values in a YAML file$ yq '.spec.replicas = 3' deployment.yaml
filter array items by a condition$ yq '.items[] | select(.status == "active")' data.yaml