#env #environment #dotenv #cli #env-var #env-file

bin+lib envset

A command-line tool for setting environment variables in a .env file

12 releases

new 0.1.11 Sep 12, 2024
0.1.10 Sep 11, 2024

#170 in Configuration

Download history 73/week @ 2024-09-01 936/week @ 2024-09-08

1,009 downloads per month

ISC license

29KB
655 lines

envset

envset is a CLI for setting environment variables in .env files.

installation

available on homebrew and cargo:

brew install schpet/tap/envset
cargo install envset

usage

set variables

# basic usage
envset KEY1=value1 KEY2=value2

# pipe in stdin, useful for copying stuff from one env to another
echo -e "KEY1=value1\nKEY2=value2" | envset

# .env in the cwd is default, but you can use a different path
envset --file .env.test KEY1=value1

# avoid clobbering existing values
envset --no-overwrite KEY1=newvalue1

get variables

# print all key value pairs 
envset print

# print a single value
envset get KEY1

# print all keys
envset keys

delete variables

envset delete KEY1 KEY2

about

this cli was thrown together quickly with aider, i also put up a blog post explaining why i made this.

Dependencies

~1–12MB
~77K SLoC