refactor: finish moving ssh-* scripts to own installers
[webi-installers/.git] / yq / README.md
1 ---
2 title: yq
3 homepage: https://github.com/mikefarah/yq
4 tagline: |
5   yq: a lightweight and portable command-line YAML processor
6 ---
7
8 To update or switch versions, run `webi yq@stable` or `webi yq@beta`, etc.
9
10 ## Cheat Sheet
11
12 > `yq` is like [`jq`](../jq), meaning that it's like `sed` for YAML data - you
13 > can use it to slice and filter and map and transform structured data with the
14 > same ease that `sed`, `awk`, `grep` and friends let you play with text.
15
16 Usage: `yq e '<selector>' <filepath>`
17
18 Works with YAML:
19
20 ```bash
21 echo 'name: John' | yq  e '.name' -
22 ```
23
24 Works with JSON:
25
26 ```bash
27 echo '[ { "name": "John" }, { "name": "Jane" } ]' | yq e '.[].name' -
28 ```
29
30 See <https://mikefarah.gitbook.io/yq/> for the docs.