Skip to content

πŸŒ„ A intuitive CLI to organize and quickly switch .env files in whitelabel applications

Notifications You must be signed in to change notification settings

Petri-Hub/wenvi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŒ„ Wenvi

Wenvi is a simple CLI to organize and manage .env files in whitelabel applications

GitHub package.json version NPM Version GitHub Actions Workflow Status GitHub top language GitHub commit activity


Table of Contents


About

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.


Glossary

  • 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.

Features

  • 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.

Showcase

Curious in how to use it? Check out this introduction post about Wenvi!


Installation

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

Quick Start

  1. Open a terminal in your project root.

  2. Initialize your Wenvi repository with:

wenvi init
  1. Create your first environment
wenvi create company-a development
  1. Use your first environment
wenvi use company-a development
  1. Enjoy!

Commands

init

Creates the repository folder where the subjects and environments are going to be stored.

  • Usage:
    • wenvi init

create

Creates a subject or environment.

  • Usage:
    • wenvi create <subject>
    • wenvi create <subject> <environment>
    • wenvi create <subject> <environment> <variables>"
  • Example:
    • wenvi create company-a
    • wenvi create company-a development
    • wenvi create company-a development "SECRET=123..."

list

Lists all the registered subjects and their environments.

  • Usage:
    • wenvi list
    • wenvi list <subject-1> <subject-2> ...
  • Example:
    • wenvi list
    • wenvi list company-a company-b

use

Switch your current .env file with the selected environment.

  • Usage:
    • wenvi use <subject> <environment>
  • Example:
    • wenvi use company-a production

current

See the environment you're currently using.

  • Usage:
    • wenvi current

copy

Copy the variables of an environment file to your clipboard.

  • Usage:
    • wenvi copy <subject> <environment>
  • Example:
    • wenvi copy company-a production

view

Outputs environment variables into the console.

  • Usage:
    • wenvi view <subject> <environment>
  • Example:
    • wenvi view company-a production

open

Opens an environment with your default text editor.

  • Usage:
    • wenvi open <subject> <environment>
  • Example:
    • wenvi open company-a production

update

Updates an environment with new variables.

  • Usage:
    • wenvi update <subject> <environment> <variables>
  • Example:
    • wenvi update company-a dev "SECRET=123..."

update-key

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

delete

Deletes a subject or environment.

  • Usage:
    • wenvi delete <subject>
    • wenvi delete <subject> <environment>
  • Example:
    • wenvi delete company-a
    • wenvi delete company-a production

get-key

Returns the value of a key in an environment.

  • Usage:
    • wenvi get-key <subject> <environment> <key>
  • Example:
    • wenvi get-key company-a production SECRET

delete-key

Deletes a key of an environment.

  • Usage:
    • wenvi delete-key <subject> <environment> <key>
  • Example:
    • wenvi delete-key company-a production SECRET

table

Shows a table that compares which subject has which environment.

  • Usage:
    • wenvi table
    • wenvi table <subject-1> <subject-2> ...
  • Example:
    • wenvi table
    • wenvi table company-a company-b

example

Setups the .env.example file that allows environments validation.

  • Usage:
    • wenvi example

export

Export all your subjects and environments into a local file.

  • Usage:
    • wenvi export

import

Import an exported Wenvi configuration.

  • Usage:
    • wenvi import

validate

Validates all your environments following the .env.example file structure.

  • Usage:
    • wenvi validate

version

Outputs the current Wenvi version installed.

  • Usage:
    • wenvi version

upgrade

Upgrades the Wenvi CLI to the latest version.

  • Usage:
    • wenvi upgrade

docs

Open the Wenvi documentation in your browser.

  • Usage:
    • wenvi docs

help

Outputs the available Wenvi commands.

  • Usage:
    • wenvi help

License

This project is licensed under the MIT License.

About

πŸŒ„ A intuitive CLI to organize and quickly switch .env files in whitelabel applications

Topics

Resources

Stars

Watchers

Forks