Coder Social home page Coder Social logo

periaate / envi Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 31 KB

Envi stores and loads encrypted .env files and uses them to run programs in subprocesses.

License: MIT License

Go 100.00%
encryption-tool environment-variables environment utility cli

envi's Introduction

Does this README explain what the program does and how it can be used?

Envi

Envi allows for storing and running programs with environment variables which are stored in an encrypted file.

Help

envi - A simple tool to encrypt and decrypt environment variables.
Usage:
  envi [options] [arguments]
Note: if there are conflicting or overlapping flags or options, use '--' to separate `[options]` from `[arguments]`.

Application Options:
  -E, --encode  Encrypts input environment variables into a .env.AES file.
  -D, --decode  Decodes environment variables from an .env.AES file.
  -i, --input=  Filepath to the .env, .env.AES files. By default it uses any .env file in the current directory.
  -o, --output= Filepath to write the encrypted/decrypted environment variables to. (default: .env.AES)
  -A, --adopt   Adopt the current processes environment variables to add to encoding/decoding.
  -d, --debug   Show debug information.

Help Options:
  -h, --help    Show this help message

Examples

We will be using the printenv program to demonstrate the functionality of envi.

Let's say that we have the following .env file

AB=CD
NAME=Periaate

Now we can encrypt that .env file into an encrypted version by using the -E or --encode flags:

envi -E
>Enter passkey:
>.env.AES file saved successfully.

By default, encryption tries to read from ./.env, but we can also specify which file(s) we want it to use.

We can now use envi to call printenv with our encrypted env file:

envi printenv
>Enter passkey:
AB=CD
NAME=Periaate

Let's make another .env file .env-dev.

DEV_KEY=DEV_VAL
NUM=10
AB=DE

We can use a specific file with the -i or --input flag. If we aren't using an encrypted file, no passkey will be asked.

envi -i .env-dev printenv
DEV_KEY=DEV_VAL
NUM=10
AB=DE

Multiple inputs may be specified. Environment variables from encrypted files take priority over others.

envi -i .env-dev -i .env.AES printenv
>Enter passkey:
AB=CD
NAME=Periaate
DEV_KEY=DEV_VAL
NUM=10

Multiple inputs may also be specified when encoding. If the same environment variable exists in multiple files, the prior value will be overwritten.

envi -i .env -i .env-dev -E
>Enter passkey:
envi printenv
>Enter passkey:
NAME=Periaate
DEV_KEY=DEV_VAL
NUM=10
AB=DE // `.env`s `AB=CD` overwritten with `.env-dev`s `AB=DE`

Files can be decrypted with -D or --decrypt flags.

envi -D
>Enter passkey:
NAME=Periaate
DEV_KEY=DEV_VAL
NUM=10
AB=DE

envi's People

Contributors

periaate avatar

Stargazers

Matheus da Silva Garcias avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.