Skip to content

Repository files navigation

envtpl

A CLI tool for generating .env files from .env.template files via prompts and random values.

Installation

Using curl:

curl -sfL https://raw.githubusercontent.com/flexstack/envtpl/main/install | bash

Using go install:

go install github.com/flexstack/envtpl

Usage

envtpl [template-file] -o [output-file]

Supported types

# .env.template
UUID=<uuid>
PASSWORD=<alpha:24>
ENCRYPTION_KEY=<ascii85:32>
ENCRYPTION_IV=<base64:16>
ENCRYPTION_SALT=<hex:16>
PORT=<int:1024-65535>
ENUM=<enum:development,production>
PROMPT=<text:Enter your name>
SECRET_PROMPT=<password:Enter your password>
PROMPT_2= # Empty values elicit a prompt
TypeDescriptionExample
alphaRandom alphanumeric charactersPASSWORD=<alpha:24>
ascii85Random ASCII charactersENCRYPTION_KEY=<ascii85:32>
base64Random base64 charactersENCRYPTION_IV=<base64:16>
hexRandom hexadecimal charactersENCRYPTION_SALT=<hex:16>
uuidRandom UUIDv4UUID=<uuid>
enumEnumerated list of valuesENUM=<enum:development,production>
intRandom integerPORT=<int:1024-65535>
textPrompt user for text inputPROMPT1=<text:Enter your name>
passwordPrompt user for secret inputSECRET_PROMPT=<password:Enter your API key>

About

A CLI tool for generating .env files from .env.template files via prompt

Topics

Resources

Code of conduct

Stars

1 star

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages