gttp-cli / gttp

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

Home Page:https://gttp.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

💻 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!

https://gttp.dev

License:MIT License


Languages

Language:Go 95.2%Language:Dockerfile 4.1%Language:Makefile 0.6%