Categorygithub.com/gttp-cli/gttp
repositorypackage
0.0.0-20240212103557-1d0df6fc1aaf
Repository: https://github.com/gttp-cli/gttp.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

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

PlatformCommand
Windowsiwr instl.sh/gttp-cli/gttp/windows | iex
macOScurl -sSL instl.sh/gttp-cli/gttp/macos | bash
Linuxcurl -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