Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/calasanmarko/group-dotenv
Centrally manage multiple .env files
https://github.com/calasanmarko/group-dotenv
bash cli dotenv env environment environment-variables shell variables
Last synced: 24 days ago
JSON representation
Centrally manage multiple .env files
- Host: GitHub
- URL: https://github.com/calasanmarko/group-dotenv
- Owner: calasanmarko
- License: mit
- Created: 2023-10-12T11:51:16.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-31T00:49:01.000Z (about 1 year ago)
- Last Synced: 2024-01-25T14:32:55.528Z (11 months ago)
- Topics: bash, cli, dotenv, env, environment, environment-variables, shell, variables
- Language: Shell
- Homepage: https://www.npmjs.com/package/group-dotenv
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# group-dotenv
*Centrally manage multiple .env files*# Installation
Available as a npm package
```
npm install --global group-dotenv
```# Usage
Inserts environment variables in multiple `.env` files based on a centrally-managed YAML configuration file.```
Usage:
group-dotenv [-q]
group-dotenv [-q]
group-dotenv pull ... [-q] [-o output-file]Options:
-q: Quiet mode (suppress output except for errors)
-o: Specify output file for the 'pull' command. Default is 'group-dotenv.yaml'.Applies the given environment variables to the .env files specified in the config file.
By default, the script looks for 'group-dotenv.yaml' in the current directory.
```# Configuration
The general format of the YAML config file is as follows:
```
variables:
- name: NODE_ENV
values:
- "./.env": development
"./.env.staging": staging
"./.env.production": production
- name: ANOTHER
values:
- "./.env": v1
"./.env.staging": v2
"./.env.production": v3
```Running `group-dotenv` with this configuration will result in the following file at `./.env`
```
NODE_ENV=development
ANOTHER=v1
```
...and so forth for the other `.env` files mentioned in the script.# Pull
The pull functionality reverses the process, generating a `group-dotenv.yaml` file from the passed `.env` files.For instance, running
```
group-dotenv pull .env .env.staging .env.production
```after running the example under **Configuration** will reverse the process and regenerate the sample `group-dotenv.yaml` file.
# License
Made by Marko Calasan, 2023.This product is licensed under the **MIT License**.