yq
CLI>=4.0A lightweight YAML, JSON, and XML processor.
6 views
Installation
Homebrew
brew install yqLinks
License
MITAI Agent Notes
Query and edit YAML/JSON/XML files like jq for YAML
When to use
Editing Kubernetes manifests, CI config, or any YAML files
Examples
yq '.spec.replicas' deploy.yamlyq -i '.version = "2.0"' config.yaml
Proven Recipes
Read a YAML value🟢 98% success
yq '.spec.replicas' deploy.yamlEdit YAML in-place🟢 95% success
yq -i '.version = "2.0"' config.yaml⚠ Common failures (1)
- File becomes empty → Backup first; yq -i only works with mikefarah/yq not Python yq
Convert YAML to JSON🟢 97% success
yq -o json config.yaml