Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jondotsoy/envctl
Manager envs files
https://github.com/jondotsoy/envctl
envs
Last synced: 24 days ago
JSON representation
Manager envs files
- Host: GitHub
- URL: https://github.com/jondotsoy/envctl
- Owner: JonDotsoy
- License: mit
- Created: 2024-01-27T03:09:14.000Z (10 months ago)
- Default Branch: develop
- Last Pushed: 2024-03-13T20:24:40.000Z (8 months ago)
- Last Synced: 2024-04-09T22:06:41.657Z (7 months ago)
- Topics: envs
- Language: TypeScript
- Homepage:
- Size: 122 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# envctl
To manager many env files.
**Example:**
```shell
# Initialize some environments
$ cat `FOO=biz` > .envs/staging
$ cat `FOO=taz` > .envs/rc# Initialize the template file (Optional)
$ cat 'PORT=300\nFOO=' > .envs/template# Now choice one
$ envctl use staging
```## Install with brew
```shell
brew install jondotsoy/core/envctl
```## Guide
1. Make your sources write many `.envs/` files.
2. Write your template on `.env.template`**Example:**
```
# find .*
.env.template
.env.staging
.envs/rc1
.envs/rc2
```3. Now run the next command `envctl use ` to write the final `.env` file and enjoy.
## Template
The template is used to make a `.env` file in the workspace directory. This file is filed with the `envctl use` command.
> For security, the `envctl use` command never adds variables to the final `.env` file.
**Templates locations:**
The `envctl use` find the template on the next alternatives:
- `.envs/template`
- `.env.template`
- `.env.sample`
- `.env.example`If a template does not exist, it will try to use the `.env` file as a template. This strategy is so useful to update the template only on local.
## Sources
A source is used to fill a template and make the final `.env` file.
Those are valid sources:
- `.env.foo`
- `.foo.env`
- `.envs/foo`
- `.envs/.foo`
- `.envs/foo.env`
- `.envs/.foo.env`Use that you prefer.
> Preferably, add `.envs/` on your `.gitignore` file to prevent pushing the secrets.