Skip to content
/ envy Public

A CLI tool to manage your env files for your projects

License

Notifications You must be signed in to change notification settings

softmaxer/envy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Envy

A simple CLI tool to manage environment variables for your project and prevent you from pushing .env files into production by accident. Made with VHS

Overview

Envy is a simple CLI tool to safely store and recover .env files for projects. It's written in Go using the cobra cli tool and lipgloss for styling. Envy uses an AES encryption to store your environment variables in a .pack file which you can unpack as you like. Envy also removes the .env file from the given folder and replaces it with a placeholder .env-dist file, once it's packed as it's generally not a good practice to push them onto repos.

Installation

Official releases

Head on over to the Releases page to pickout the release that best fits your requirements and add it to your computer's bin (/usr/bin or /usr/local/bin)

Curl

curl -L https://github.com/softmaxer/envy/releases/download/v0.1.6/envy_Darwin_arm64.tar.gz > envy.tar.gz
tar -xzvf envy.tar.gz

Once installed, Either add the path to the $PATH variable or move it to bin (might require sudo):

mv envy /usr/local/bin/envy

Using go

Or, you can also install it with go:

go install github.com/softmaxer/envy

Usage

As a Binary

  • Start a new envy vault by typing

    envy new

    This will start a new fault in your $HOME under the directory .envy.

  • Once a vault is setup, headover to any git repo / project folder which contains an env file and type:

    envy pack

    This should encrypt your environment variables in your vault. The project name under which the file is encrypted will be the name of your current directory. If you want to change, that:

    envy pack <project-name>

    This will also remove the env file from the current directory to make sure your code is safe to be pushed onto a repositorty.

  • to unpack, Just simply type:

    envy unpack

    Or with a project name:

    envy unpack <project-name>

As a precommit hook

Copy the following snippet into your .pre-commit-config.yaml

repos:
-   repo: https://github.com/softmaxer/envy
    rev: v0.1.12
    hooks:
    -   id: envy-new
    -   id: envy-pack

NOTE: This will make your pre-commit hook fail if you have the .env file tracked by git. This is expected behavior. However, the program itself will succeed if it finds an env i.e., it will still hash your env into a vault and replace it with an env-dist