Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
Command line tool that compiles Golang
[templates](http://golang.org/pkg/text/template/) with values from YAML files.

Inspired by Python/Jinja2's [j2cli](https://github.com/kolypto/j2cli).
## Install global CLI

## Install

go get github.com/tsg/gotpl
```shell
go install github.com/huantt/gotpl@latest
```

```shell
export PATH=$PATH:$(go env GOPATH)/bin
```
## Usage

Say you have a `template` file like this:
Expand All @@ -24,3 +27,14 @@ and a `user.yml` YAML file like this one:
You can compile the template like this:

gotpl template < user.yml

Or
```shell
cat user.yaml | gotpl template
```

Use multiple value files
```shell
cat values-1.yaml values-2.yaml | gotpl template
# Note that end of value-1.yaml must be new line to separate with value-2.yaml
```