CmdID

CmdID / Commands

yq

A lightweight and portable YAML processor. tldr-pages

On several platforms

Opens CmdID with your command. It is read in your browser and sent nowhere.

Several platforms

from tldr-pages, CC BY 4.0

Output a YAML file, in pretty-print format (v4+)

yq eval path/to/file.yamlIdentify

Output a YAML file, in pretty-print format (v3)

yq read path/to/file.yaml --colorsIdentify

Output the first element in a YAML file that contains only an array (v4+)

yq eval '.[0]' path/to/file.yamlIdentify

Output the first element in a YAML file that contains only an array (v3)

yq read path/to/file.yaml '[0]'Identify

Set (or overwrite) a key to a value in a file (v4+)

yq eval '.key = "value"' --inplace path/to/file.yamlIdentify

Set (or overwrite) a key to a value in a file (v3)

yq write --inplace path/to/file.yaml 'key' 'value'Identify

Merge two files and print to stdout (v4+)

yq eval-all 'select(filename == "path/to/file1.yaml") * select(filename == "path/to/file2.yaml")' path/to/file1.yaml path/to/file2.yamlIdentify

Merge two files and print to stdout (v3)

yq merge path/to/file1.yaml path/to/file2.yaml --colorsIdentify