What is yq?

yq processes structured configuration files including YAML.

Homebrew installs yq as a formula: a package definition for command-line software and its dependencies. If Homebrew is not installed yet, follow the official installation guide before continuing.

Install and check the formula

Refresh Homebrew’s package definitions, then install yq. Use brew info to inspect the current package and its dependencies; the actual installed version can change over time.

brew update
brew install yq
brew info yq

Try it

The example reads a YAML document from standard input and selects its name field.

yq --version
printf "name: Casklane\n" | yq ".name"

Before you rely on it

Different tools are named yq. Verify the installed tool and its help before reusing a filter from another implementation.

jq is a good fit for JSON; choose the tool that matches the data format and scripts you maintain.

Update or remove it

Run brew outdated to see if a newer version is available, and brew upgrade yq to upgrade this formula. Before removing it, preview the changes; other packages may depend on it.

brew outdated
brew upgrade yq
brew uninstall --dry-run yq

Sources and further reading