envset 0.1.7

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

envset

envset is a command-line tool for setting environment variables in a .env file. it allows you to easily add or update environment variables without manually editing the .env file.

this cli was thrown together quickly with aider

usage

set environment variables

envset KEY1=value1 KEY2=value2
# .env file contents after running the command:
KEY1=value1
KEY2=value2

set environment variables from stdin

echo -e "KEY1=value1\nKEY2=value2" | envset
# .env file contents after running the command:
KEY1=value1
KEY2=value2

use a custom .env file location

envset --file .env.test KEY1=value1
# .env.test file contents after running the command:
KEY1=value1

by default, envset will create or update a .env file in the current directory. if you want to use a different file, you can specify it with the --file option.

get the value of a single environment variable

envset get KEY1

This command will print the value of KEY1 from the .env file. If the variable is not found, it will print an error message.

you can also specify a custom .env file location when using the get subcommand:

envset --file .env.test get KEY1

installation

homebrew

brew install schpet/tap/envset

cargo

cargo install envset