Skip to content

EnvPrompter is a CLI tool for automating .env file creation. It detects missing .env files, prompts for required values based on project config, and generates them, streamlining development setups and ensuring secure, consistent configurations.

License

OfekShimko/EnvPrompter

Repository files navigation

EnvPrompter

EnvPrompter is a powerful CLI tool designed to automate the creation of .env files for your projects. By detecting missing .env files and prompting you to input required values based on a project-specific configuration, EnvPrompter streamlines development setups and ensures secure and consistent configurations across environments.

Features

  • Automatic Detection: Quickly identifies missing .env files in your project.
  • Customizable Prompts: Guides you through entering environment variable values using custom prompts.
  • Secure Configuration: Facilitates a secure way to handle sensitive information by avoiding hardcoded values.
  • Easy Integration: Seamlessly integrates with existing projects with minimal setup.

Installation

To install EnvPrompter, run the following command in your terminal:

npm install -g envprompter

Or if you prefer using yarn:

yarn global add envprompter

Usage

  1. Create a Configuration File: Create a file named envprompter.config.json in the root of your project directory. Here is an example configuration:
{
    "variables": [
        {
            "name": "example",
            "prompt": "Please enter the example value",
        },
        {
            "name": "optional field",
            "prompt": "Please enter a value for the optional field",
            "optional": true
        }
    ]
}
  1. Run EnvPrompter: Simply execute EnvPrompter in your terminal by running:
envprompter

EnvPrompter will then detect if your .env file is missing and prompt you for the required values as specified in your configuration file.

Configuration

The envprompter.config.json file is where you define the environment variables needed for your project. Each variable requires a name, a prompt message to display, and a boolean required field to indicate whether the variable is essential.

Contributing

We welcome contributions to EnvPrompter! If you're interested in helping improve this tool, please take a look at our contributing guidelines. To get started:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Submit a pull request with a detailed description of your changes.

License

EnvPrompter is open source software licensed as MIT. Feel free to use, modify, and distribute it as per the license.

About

EnvPrompter is a CLI tool for automating .env file creation. It detects missing .env files, prompts for required values based on project config, and generates them, streamlining development setups and ensuring secure, consistent configurations.

Resources

License

Stars

Watchers

Forks

Packages

No packages published