Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wickes1/envex
Dotenv sample made easy!
https://github.com/wickes1/envex
cli dotenv golang
Last synced: 7 days ago
JSON representation
Dotenv sample made easy!
- Host: GitHub
- URL: https://github.com/wickes1/envex
- Owner: wickes1
- License: apache-2.0
- Created: 2024-04-15T18:09:03.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-04-16T02:24:48.000Z (7 months ago)
- Last Synced: 2024-08-02T16:34:46.506Z (3 months ago)
- Topics: cli, dotenv, golang
- Language: Go
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Envex
Envex (Env Example) is a command-line tool written in Go for generating sample dotenv files from existing `.env` files. It helps streamline the process of creating sample environment configuration files for your projects.
## Installation
### Go
You can install Envex directly from Go:
```bash
go install github.com/wickes1/envex@latest
```### Arch User Repository (AUR)
If you're using an Arch-based Linux distribution, you can install Envex from the AUR:
```bash
yay -S envex-bin
```## Usage
```bash
go install github.com/wickes1/envexenvex generate
# Sample dotenv file has been saved to: .env.example# Specify input and output files
envex generate -f .env -o .env.sample# Retain comments
envex generate -c
```## Example
Given the following `.env` file:
```env
# Example dotenv# Database
DB_HOST=localhost
DB_USER=root
DB_PASS=secret
DB_NAME=database# App
APP_NAME=MyApp
APP_ENV=development
APP_DEBUG=true
APP_URL=http://localhost:8000
```Running `envex generate` will generate the following `.env.example` file:
```env
DB_HOST=
DB_USER=
DB_PASS=
DB_NAME=
APP_NAME=
APP_ENV=
APP_DEBUG=
APP_URL=
```Running `envex generate -c` will retain the comments:
```env
# Example dotenv# Database
DB_HOST=
DB_USER=
DB_PASS=
DB_NAME=# App
APP_NAME=
APP_ENV=
APP_DEBUG=
APP_URL=
```