Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/otaviof/gq
Command-line Go Templates processor for YAML/JSON
https://github.com/otaviof/gq
Last synced: about 1 month ago
JSON representation
Command-line Go Templates processor for YAML/JSON
- Host: GitHub
- URL: https://github.com/otaviof/gq
- Owner: otaviof
- License: apache-2.0
- Created: 2020-04-17T21:14:54.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-04-20T17:04:43.000Z (over 4 years ago)
- Last Synced: 2024-06-19T11:32:34.537Z (5 months ago)
- Language: Go
- Homepage:
- Size: 1.52 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `gq`
Is a swissarmy knife text processor to apply [Go Templates][gotmpl] against structure file formats,
like YAML and JSON, heavily inspired on [`jq`][jq] and [`yq`][yq].For instance:
```sh
gq '{{ index . "current-context" }}' ~/.kube/config
cat ~/.kube/config |gq '{{ index . "current-context" }}'
gq --type=json '{{ range .HttpHeaders }}{{ printf "%s\n" . }}{{ end }}' ~/.docker/config.json
```## Installing
You can use `gq` as a [container-image][containerimage], or get it locally via:
```sh
go get -u github.com/otaviof/gq
```When having a local clone of this repository, you may:
```sh
make install
```[containerimage]: https://quay.io/otaviof/gq
[gotmpl]: https://golang.org/pkg/text/template/
[jq]: https://stedolan.github.io/jq/
[yq]: https://github.com/mikefarah/yq