← Software

yq

A command-line YAML, JSON, XML, CSV, and TOML processor.

yq applies jq-style queries to YAML, JSON, XML, CSV, and TOML documents. It can also convert between formats — read YAML, emit JSON; read CSV, emit YAML — which is useful for editing Kubernetes manifests, Helm values files, and CI configuration from shell pipelines. The query language is the same one jq uses, with extensions specific to each input format.

Mike Farah's yq is the implementation written in Go that has become the de facto reference. There is also a Python yq from kislyuk, which is a thin wrapper around jq that converts YAML to JSON internally; the Go yq is the one most people mean today.

yq is indispensable for anyone scripting Kubernetes work from the shell. It is also widely used in CI pipelines that need to inject build-specific values into deployment manifests, and in local "view this YAML configured a particular way" inspection during config debugging.

License: MIT

Category: CLI tools

Website: https://mikefarah.gitbook.io/yq/

Install

Debian/Ubuntu: sudo apt install yq
Fedora/RHEL:   sudo dnf install yq
Arch:          sudo pacman -S go-yq
macOS:         brew install yq

Authors

  • Mike Farah (creator)
PreviousXZ Utils NextZ shell (Zsh)

This site is currently in Beta. Contact: Chris Paton

Textbook of AI · Textbook of Usability · Textbook of Digital Health

Auckland Maths and Science Tutoring