June 22nd, 2024

Show HN: Envelope – A modern environment variable cli tool

The GitHub repository features "envelope," a Rust tool for handling environment variables via SQLite. Commands include add, check, delete, drop, duplicate, export, edit, init, import, list, and help. Simplifies environment configuration management.

Read original articleLink Icon
Show HN: Envelope – A modern environment variable cli tool

The GitHub repository contains information about "envelope," a Rust-based tool for managing environment variables using an SQLite database. It offers commands like add, check, delete, drop, duplicate, export, edit, init, import, list, and help. Users can pretty print, import, list, export, add, delete, drop, and check environment variables. To use envelope, download the binary from the latest release or build it from source with the Rust compiler. This tool simplifies managing and switching between various environment configurations efficiently.

Link Icon 14 comments
By @leetrout - 4 months
A word of caution - this is a way to leak your secrets through your shell history:

  $ envelope add dev db_pwd pwd
There are settings such that a command that starts with a space will not be saved in the history which would help here but I would be very careful about how you use this.
By @bloopernova - 4 months
Interesting!

Have you looked at mise-en-place at all? It's written in rust too, and might have some cool ideas to use: https://mise.jdx.dev/

By @breck - 4 months
I like it.

Env variables should be a solved problem but no one has made the simplest general solution yet. Seems like you are on track.

One suggestion: no need to use SQLite. Just develop a simple (and _lasting_), plain text DSL and save to a file.

Here's one I made using your example.

https://sdk.scroll.pub/designer/#parsers%0A%20valueCell%0A%2...

I'm happy to chat more to nail that design if that would be helpful.

By @tomwphillips - 4 months
Of all the adjectives to use, why “modern”?

Very common these days. I don’t get it.

By @Kwpolska - 4 months
The docs don’t make it very obvious how are the environment variables actually applied. And I think .env files are much easier to manage and share. `envelope check` could be replaced with a CURRENT_ENV environment variable in an .env file. I can’t see how it would help avoid environment confusion more than $CURRENT_ENV displayed in your prompt would. (Or even better, not having production credentials on developers’ machines…)
By @globular-toast - 4 months
Seems neat, but direnv can do more despite this claiming to be "modern".
By @another-dave - 4 months
> This way I am explicitly exporting the dev environment without relying on the fact that everything is in order in my .env file (another approach would be to have a .env.dev file)

What did you find lacking with the .env.dev approach? (Or if some tool doesn't support .env.dev could always symlink .env → .env.dev)

By @stephenr - 4 months
> I had the test database url commented out and the production one was not.

I feel like this is a giant red flag. Why on earth is your production database accessible from anywhere (ie your PC) without some kind of extra layer of security like a VPN or SSH tunnel?

By @skeledrew - 4 months
Hmm I fairly recently started saving variables which tend to be shared among multiple projects in a central location, grouped in sh files and sourcing as needed. This gives me an idea to improve that flow...
By @applgo443 - 4 months
When i deploy a webapp on azure, it expects me to put env variables in a file or their own tool (key value fields) where you can add env variables one by one.

Is there a way to use envelope in places like those?

By @SeriousM - 4 months
envkey.com is also distributing environment variables
By @nodesocket - 4 months
Any plans to support encryption at rest?
By @cranberryturkey - 4 months
how do I install the damn thing??
By @twerkmonsta - 4 months
you probably don’t need sql