# group-dotenv

> Centrally manage multiple .env files

Latest version **1.1.5** (published 2023-10-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install group-dotenv
pnpm add group-dotenv
yarn add group-dotenv
bun add group-dotenv
```

Provides the command `group-dotenv`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.5 |
| Published | 2023-10-31 |
| First published | 2023-10-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Marko Calasan |
| Maintainers | calasanmarko |
| Keywords | dotenv, env, environment, variables, environment-variables, cli, bash, shell |

## Links

- npm: https://www.npmjs.com/package/group-dotenv
- Repository: https://github.com/calasanmarko/group-dotenv
- Homepage: https://github.com/calasanmarko/group-dotenv#readme
- Issues: https://github.com/calasanmarko/group-dotenv/issues
- npm.io page: https://npm.io/package/group-dotenv

## Alternatives

- [replicas-cli](https://npm.io/package/replicas-cli.md) — 3.0K weekly downloads
- [env-contract](https://npm.io/package/env-contract.md) — 133 weekly downloads
- [@openveo/api](https://npm.io/package/@openveo/api.md) — 61 weekly downloads
- [@ryniaubenpm2/cumque-error-reiciendis](https://npm.io/package/@ryniaubenpm2/cumque-error-reiciendis.md) — 54 weekly downloads
- [ts-global-type-extra](https://npm.io/package/ts-global-type-extra.md) — 11 weekly downloads

## Recent versions

- 1.1.5 (latest) — 2023-10-31
- 1.1.4 — 2023-10-16
- 1.1.3 — 2023-10-16
- 1.1.2 — 2023-10-16
- 1.1.1 — 2023-10-12
- 1.1.0 — 2023-10-12
- 1.0.4 — 2023-10-12
- 1.0.3 — 2023-10-12
- 1.0.2 — 2023-10-12
- 1.0.1 — 2023-10-12
- 1.0.0 — 2023-10-12

## 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 <config-file> [-q]
  group-dotenv pull <file1> <file2> ... [-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**.

---
_Source: https://npm.io/package/group-dotenv · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
