yq
yq is a lightweight and portable command-line YAML processor
Last updated
yq is a lightweight and portable command-line YAML processor
Last updated
v3 is now deprecated, critical bug fixes and security fixes will still be applied until August 2021.
yq
has pre-built binaries for most platforms - checkout the releases page for the latest build. Alternatively - you can use one of the methods below:
Note that as this is a versioned brew it will not add the yq
command to your path automatically. Please follow the instructions given by brew upon installation.
Kindly maintained by @chillum (https://github.com/chillum/choco-packages/tree/master/yq), https://chocolatey.org/packages/yq
Enable edge/community repo by adding $MIRROR/alpine/edge/community
to /etc/apk/repositories
Update database index with apk update
Install yq with apk add yq
Supported by Tuan Hoang https://pkgs.alpinelinux.org/package/edge/community/x86/yq
snap
packages:yq
installs with with strict confinement in snap, this means it doesn't have direct access to root files. To read root files you can:
And to write to a root file you can either use sponge:
or write to a temporary file:
Kindly maintained by @rmescandon
Oneshot use:
Run commands interactively:
It can be useful to have a bash function to avoid typing the whole docker command:
Under the hood, yq uses go-yaml v3 as the yaml parser, which supports yaml spec 1.2. In particular, note that in 1.2 the values 'yes'/'no' are no longer interpreted as booleans, but as strings.