Skip to content
/ gttp Public

Go Text Template Parser - Create templates for emails, reports, PR descriptions, etc. and fill them out interactively!

License

Notifications You must be signed in to change notification settings

gttp-cli/gttp

Repository files navigation

💻 GTTP | Go Text Template Parser

A modern CLI to create and fill out reusable text templates

Latest Release Stars Forks License: MIT
Downloads

Introduction

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

Installation

There are multiple ways to install gttp on your system.

Install Using Web Installer

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.

Install using Go

If you have Go installed, you can install gttp using the following command:

go install github.com/gttp-cli/gttp@latest

Docs

Docs are available at: https://docs.gttp.dev

About

Go Text Template Parser - Create templates for emails, reports, PR descriptions, etc. and fill them out interactively!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published