Wenvi is a Node.js CLI tool written in TypeScript designed to manage .env files in whitelabel applications. It simplifies the process of handling environment variables across different subjects and environments, making it easier to manage configurations for various deployments.
- Subject: The entity that requires its own set of environments, in most cases, a company you're working for.
- Environment: A collection of variables that represents a stage of deployment such as development or production.
- Create, delete and list subjects and environments.
- Open subjects and environments in your favorite editor.
- Validate all your environments variables with an example file.
- Display subjects and environments in a friendly table format.
- Quickly switch your current environment.
- Export and import subjects and environments.
Curious in how to use it? Check out this introduction post about Wenvi!
To install Wenvi, you need to have Node.js and npm installed on your machine. Then, run the following npm command:
npm install -g wenvi-
Open a terminal in your project root.
-
Initialize your Wenvi repository with:
wenvi init- Create your first environment
wenvi create company-a development- Use your first environment
wenvi use company-a development- Enjoy!
Creates the repository folder where the subjects and environments are going to be stored.
- Usage:
wenvi init
Creates a subject or environment.
- Usage:
wenvi create <subject>wenvi create <subject> <environment>wenvi create <subject> <environment> <variables>"
- Example:
wenvi create company-awenvi create company-a developmentwenvi create company-a development "SECRET=123..."
Lists all the registered subjects and their environments.
- Usage:
wenvi listwenvi list <subject-1> <subject-2> ...
- Example:
wenvi listwenvi list company-a company-b
Switch your current .env file with the selected environment.
- Usage:
wenvi use <subject> <environment>
- Example:
wenvi use company-a production
See the environment you're currently using.
- Usage:
wenvi current
Copy the variables of an environment file to your clipboard.
- Usage:
wenvi copy <subject> <environment>
- Example:
wenvi copy company-a production
Outputs environment variables into the console.
- Usage:
wenvi view <subject> <environment>
- Example:
wenvi view company-a production
Opens an environment with your default text editor.
- Usage:
wenvi open <subject> <environment>
- Example:
wenvi open company-a production
Updates an environment with new variables.
- Usage:
wenvi update <subject> <environment> <variables>
- Example:
wenvi update company-a dev "SECRET=123..."
Updates an environment key with a new value.
- Usage:
wenvi update-key <subject> <environment> <key> <value>
- Example:
wenvi update-key company-a dev SECRET 123
Deletes a subject or environment.
- Usage:
wenvi delete <subject>wenvi delete <subject> <environment>
- Example:
wenvi delete company-awenvi delete company-a production
Returns the value of a key in an environment.
- Usage:
wenvi get-key <subject> <environment> <key>
- Example:
wenvi get-key company-a production SECRET
Deletes a key of an environment.
- Usage:
wenvi delete-key <subject> <environment> <key>
- Example:
wenvi delete-key company-a production SECRET
Shows a table that compares which subject has which environment.
- Usage:
wenvi tablewenvi table <subject-1> <subject-2> ...
- Example:
wenvi tablewenvi table company-a company-b
Setups the .env.example file that allows environments validation.
- Usage:
wenvi example
Export all your subjects and environments into a local file.
- Usage:
wenvi export
Import an exported Wenvi configuration.
- Usage:
wenvi import
Validates all your environments following the .env.example file structure.
- Usage:
wenvi validate
Outputs the current Wenvi version installed.
- Usage:
wenvi version
Upgrades the Wenvi CLI to the latest version.
- Usage:
wenvi upgrade
Open the Wenvi documentation in your browser.
- Usage:
wenvi docs
Outputs the available Wenvi commands.
- Usage:
wenvi help
This project is licensed under the MIT License.