Difference between revisions of "Yq"

From NovaOrdis Knowledge Base
Jump to: navigation, search
(Created page with "=External= =Internal= * jq =DEPLETE= {{Internal|YqTODELETE| YqTODELETE}}")
 
(Operations)
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
=External=
 
=External=
 +
* https://mikefarah.github.io/yq/
 +
 
=Internal=
 
=Internal=
 
* [[jq]]
 
* [[jq]]
Line 5: Line 7:
 
=DEPLETE=
 
=DEPLETE=
 
{{Internal|YqTODELETE| YqTODELETE}}
 
{{Internal|YqTODELETE| YqTODELETE}}
 +
 +
=Overview=
 +
yq is a lightweight and portable command-line YAML processor. It is written in Go and it consists in a single portable binary. It can be used to query a YAML file using a YAML path, to update a YAML file for a YAML path or using a script file, to create a YAML file or merge YAML files. The update operation creates any missing path elements. yq can also be used to convert YAML files to JSON and JSON files to YAML.
 +
 +
The default output is YAML, unless [[#-j|-j]] option is used.
 +
 +
=Version=
 +
 +
yq --version
 +
yq version 2.4.1
 +
 +
=Installation=
 +
==Mac==
 +
brew install yq
 +
==Linux==
 +
yq_version=2.4.1
 +
cd /tmp
 +
wget https://github.com/mikefarah/yq/releases/download/${yq_version}/yq_linux_amd64
 +
mv /tmp/yq_linux_amd64 yq /bin/yq
 +
chmod a+x /bin/yq
 +
 +
=Concepts=
 +
=Command Line Options=
 +
==-v==
 +
Provides additional details on parsing.
 +
==-j==
 +
Output formatted as JSON.
 +
 +
=Operations=
 +
==Read==

Revision as of 01:06, 15 January 2020

External

Internal

DEPLETE

YqTODELETE

Overview

yq is a lightweight and portable command-line YAML processor. It is written in Go and it consists in a single portable binary. It can be used to query a YAML file using a YAML path, to update a YAML file for a YAML path or using a script file, to create a YAML file or merge YAML files. The update operation creates any missing path elements. yq can also be used to convert YAML files to JSON and JSON files to YAML.

The default output is YAML, unless -j option is used.

Version

yq --version
yq version 2.4.1

Installation

Mac

brew install yq

Linux

yq_version=2.4.1
cd /tmp
wget https://github.com/mikefarah/yq/releases/download/${yq_version}/yq_linux_amd64
mv /tmp/yq_linux_amd64 yq /bin/yq
chmod a+x /bin/yq

Concepts

Command Line Options

-v

Provides additional details on parsing.

-j

Output formatted as JSON.

Operations

Read