Use envy
to manage sensitive environment variables when running commands.
github.com/shoenig/envy
provides a CLI utility for running commands with secret
environment variables like GITHUB_TOKEN
, etc.
envy
builds on ideas from envchain and schain.
It makes use of the go-keyring library for multi-platform keyring management.
Encryption is based on Go's built-in crypto/aes
library.
Persistent storage is managed through boltdb.
Supports Linux, macOS, and Windows
The envy
command is available to download from the Releases page.
Multiple operating systems and architectures are supported, including
- Linux
- macOS
- Windows
The envy
command can be installed from source by running
$ go install github.com/shoenig/envy@latest
NAME:
envy - wrangle environment varibles
USAGE:
envy [global options] [command [command options]] [arguments...]
VERSION:
v0
DESCRIPTION:
The envy is a command line tool for managing profiles of
environment variables. Values are stored securely using
encryption with keys protected by your desktop keychain.
COMMANDS:
list - list environment profiles
set - set environment variable(s) in a profile
purge - purge an environment profile
show - show values in an environment variable profile
exec - run a command using environment variables from profile
GLOBALS:
--help/-h boolean - print help message
$ envy set example FOO=1 BAR=2 BAZ=3
$ envy set example FOO=4
$ envy set example -FOO
$ envy exec example env
BAR=2
BAZ=3
... <many more from user> ...
$ envy exec --insulate example env
BAR=2
BAZ=3
Note that -i
is short for --insulate
.
$ envy exec --insulate example EXTRA=value env
EXTRA=value
BAR=2
BAZ-3
$ envy list
consul/connect-acls:no_tls
example
nomad/e2e
test
$ envy show test
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
$ envy show --unveil test
AWS_ACCESS_KEY_ID=aaabbbccc
AWS_SECRET_ACCESS_KEY=233kjsdf309jfsd
Note that -u
is short for --unveil
.
$ envy purge test
purged profile "test"
The github.com/shoenig/envy
module is always improving with new features
and error corrections. For contributing bug fixes and new features please file
an issue.
The github.com/shoenig/envy
module is open source under the MIT license.