A modern CLI to create and fill out reusable text templates
GTTP lets you define your text templates using YAMl.
When you execute a template file, GTTP will interactively ask you to fill out the defined variables.
The template is then parsed with the Go text/template syntax.
Use-cases for GTTP include:
- Generating configuration files
- Creating README files
- Writing documentation
- E-Mail templates
- Ticket templates
- and many more...
# yaml-language-server: $schema=https://gttp.dev/schema
structures:
person:
- name: Name
type: text
description: Name of the person
- name: Admin
type: boolean
description: Is the person an admin
variables:
- name: Users
type: person[]
template: |-
You have added the following users:
{{ range .Users }}
- {{ .Name }} is an admin: {{ .Admin }}
{{ end }}
Try the demo:
gttp -u gttp.dev/demo.yml
Or with Docker:
docker run -it --rm ghcr.io/gttp-cli/gttp:main -u gttp.dev/demo.yml
There are multiple ways to install gttp
on your system.
You can install gttp
using instl.
Using instl is the simplest way to install gttp
on your system.
Just copy the following command and paste it into your terminal:
Platform | Command |
---|---|
Windows | iwr instl.sh/gttp-cli/gttp/windows | iex |
macOS | curl -sSL instl.sh/gttp-cli/gttp/macos | bash |
Linux | curl -sSL instl.sh/gttp-cli/gttp/linux | bash |
Tip
If you want to take a look at the script before running it, you can open the instl.sh URL in your browser.
If you have Go installed, you can install gttp
using the following command:
go install github.com/gttp-cli/gttp@latest
Docs are available at: https://docs.gttp.dev