1
0
mirror of https://github.com/taigrr/yq synced 2025-01-18 04:53:17 -08:00
2020-06-16 01:19:04 +00:00
2020-06-15 21:42:26 +10:00
2020-06-15 12:31:13 +10:00
2020-01-30 10:32:34 +11:00
2020-06-15 12:31:13 +10:00
2020-06-12 12:23:18 +10:00
2019-12-09 13:44:53 +11:00
2020-06-16 01:19:04 +00:00
2020-01-09 08:17:56 +11:00
2020-03-02 08:47:19 +11:00
2020-02-21 21:13:14 +11:00
2019-12-09 13:44:53 +11:00
2020-02-21 21:16:47 +11:00
2020-04-14 11:19:00 +10:00
2017-02-10 16:00:25 +11:00
2017-12-18 15:29:41 +11:00
2020-01-30 10:32:34 +11:00
2020-06-16 01:19:04 +00:00
2020-06-16 01:19:04 +00:00
2019-12-09 13:44:53 +11:00
2020-06-10 16:55:20 +10:00

description
description
yq is a lightweight and portable command-line YAML processor

yq

Build Docker Pulls Github Releases (by Release) Go Report

Install

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:

On MacOS:

brew install yq

On Windows:

choco install yq

Kindly maintained by @chillum [https://github.com/chillum/choco-packages/tree/master/yq](https://github.com/chillum/choco-packages/tree/master/yq)

On Ubuntu and other Linux distributions supporting snap packages:

snap install yq

Snap notes

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:

sudo cat /etc/myfile | yq -r - somecommand

And to write to a root file you can either use sponge:

sudo cat /etc/myfile | yq -r - somecommand | sudo sponge /etc/myfile

or write to a temporary file:

sudo cat /etc/myfile | yq -r - somecommand | sudo tee /etc/myfile.tmp
sudo mv /etc/myfile.tmp /etc/myfile
rm /etc/myfile.tmp

On Ubuntu 16.04 or higher from Debian package:

sudo add-apt-repository ppa:rmescandon/yq
sudo apt update
sudo apt install yq -y

Kindly maintained by @rmescandon

go get:

GO111MODULE=on go get github.com/mikefarah/yq/v3

Docker

Oneshot use:

docker run --rm -v ${PWD}:/workdir mikefarah/yq yq [flags] <command> FILE...

Run commands interactively:

docker run --rm -it -v ${PWD}:/workdir mikefarah/yq sh

It can be useful to have a bash function to avoid typing the whole docker command:

yq() {
  docker run --rm -i -v ${PWD}:/workdir mikefarah/yq yq $@
}
Description
yq is a portable command-line YAML processor
Readme 9.5 MiB
Languages
Go 96.9%
Shell 1.8%
Makefile 1%
Dockerfile 0.3%