Git Product home page Git Product logo

envo's Introduction

envo

CI

envo is a bash CLI helper for loading .env (dotenv) as environment variables into any program.

screenshot

asciicast

It's a simple bash script that can come in handy when working with environment variables, testing stuff out, etc.

Install

curl https://raw.githubusercontent.com/awinecki/envo/main/envo.sh --output ~/.local/bin/envo --create-dirs && chmod +x ~/.local/bin/envo

Uninstall

rm ~/.local/bin/envo

Usage

envo <command>

Any command now has access to all env vars defined in .env file.

Pros

  • Tested with shellspec
  • Just bash, can work almost anywhere
  • Fast, almost no overhead
  • No need to use libraries for .env loading
  • Works in zsh, bash, fish (others probably too, but haven't tested)

Why not just use a simple bashism for this

There are ways to accomplish this with pure bash / sh, like this:

export (cat .env | xargs) && cmd

However, I've found this approach lacking:

  • It doesn't work in all terminals the same (I'm using fish)
  • Honestly who remembers this xargs piping spaghetti
  • I like good CLI api, and prepending my command with a handy tool that loads env vars resonates with me

Features

Specify env file (other than the default .env)

envo -f /path/to/.custom.env <my_command>

Add more env vars

envo -e SOMEVAR=VALUE -e ANOTHER=SECRET <my_command>

For more info, type envo --help.

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.