An open API service indexing awesome lists of open source software.

https://github.com/flexstack/envtpl

A CLI tool for generating .env files from .env.template files via prompt
https://github.com/flexstack/envtpl

dotenv dotenv-cli dotenv-editor dotenv-template

Last synced: 6 months ago
JSON representation

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

Awesome Lists containing this project

README

          

# envtpl

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

## Installation

Using `curl`:

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

Using `go install`:

```sh
go install github.com/flexstack/envtpl
```

## Usage

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

### Supported types

```sh
# .env.template
UUID=
PASSWORD=
ENCRYPTION_KEY=
ENCRYPTION_IV=
ENCRYPTION_SALT=
PORT=
ENUM=
PROMPT=
SECRET_PROMPT=
PROMPT_2= # Empty values elicit a prompt
```

| Type | Description | Example |
| --- | --- | --- |
| alpha | Random alphanumeric characters | `PASSWORD=` |
| ascii85 | Random ASCII characters | `ENCRYPTION_KEY=` |
| base64 | Random base64 characters | `ENCRYPTION_IV=` |
| hex | Random hexadecimal characters | `ENCRYPTION_SALT=` |
| uuid | Random UUIDv4 | `UUID=` |
| enum | Enumerated list of values | `ENUM=` |
| int | Random integer | `PORT=` |
| text | Prompt user for text input | `PROMPT1=` |
| password | Prompt user for secret input | `SECRET_PROMPT=` |