https://github.com/twilio-labs/configure-env
Configures your project's environment by creating a .env file.
https://github.com/twilio-labs/configure-env
cli dotenv nodejs twilio-labs
Last synced: about 1 year ago
JSON representation
Configures your project's environment by creating a .env file.
- Host: GitHub
- URL: https://github.com/twilio-labs/configure-env
- Owner: twilio-labs
- License: mit
- Created: 2019-11-19T18:45:28.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-09-06T02:09:42.000Z (almost 2 years ago)
- Last Synced: 2025-05-07T14:58:41.502Z (about 1 year ago)
- Topics: cli, dotenv, nodejs, twilio-labs
- Language: TypeScript
- Size: 1.44 MB
- Stars: 6
- Watchers: 1
- Forks: 3
- Open Issues: 37
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
configure-env
CLI tool to generate and populate .env files from .env.example templates.
[](#contributors-)
## About
`configure-env` will read a `.env.example` or any other similar `.env` file and prompt for values for each variable that has a comment header above it. Afterwards it will generate a `.env` file out of it.
It works as a more user-friendly approach to:
```
cp .env.example .env
```
## Installation
You can install the CLI tool via `npm` or another package manager. Ideally install it as a dev dependency instead of global:
```bash
# Install it as a dev dependency
npm install configure-env --save-dev
# Afterwards you can use by using:
node_modules/.bin/configure-env
npx configure-env
# Or inside your package.json scripts section as "configure-env"
```
## Usage
In a project that contains a `.env.example` file, run:
```bash
$ npx configure-env --help
Prompts user for environment variables and generates .env files based on a
.env.example file
Usage:
configure-env.js -o [outputFile] -i [exampleFile]
Options:
--help Show help [boolean]
--version Show version number [boolean]
--output, -o Location of the .env file that should be written
[string] [default: ".env"]
--input, -i Location of input .env.example file for prompts
[string] [default: ".env.example"]
--verbose [boolean] [default: false]
Examples:
npx configure-env Reads a .env.example file in the current directory and
creates a .env file
configure-env.js | cat The output can be either written to a file or piped to
another process
This project is part of Twilio Labs. Please file any issues
github.com/twilio-labs/configure-env
```
## Contributing
This project welcomes contributions from the community. Please see the [`CONTRIBUTING.md`](CONTRIBUTING.md) file for more details.
### Code of Conduct
Please be aware that this project has a [Code of Conduct](CODE_OF_CONDUCT.md). The tldr; is to just be excellent to each other ❤️
## Contributors
Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
## License
[MIT](LICENSE)