https://github.com/shoenig/envy
Use envy to securely manage environment variables with your OS keychain
https://github.com/shoenig/envy
environment environment-variables envy hacktoberfest passwords secrets secrets-management secrets-manager variables
Last synced: about 1 year ago
JSON representation
Use envy to securely manage environment variables with your OS keychain
- Host: GitHub
- URL: https://github.com/shoenig/envy
- Owner: shoenig
- License: mit
- Created: 2020-04-11T05:35:36.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-11-01T03:16:09.000Z (over 1 year ago)
- Last Synced: 2025-03-19T01:31:34.930Z (over 1 year ago)
- Topics: environment, environment-variables, envy, hacktoberfest, passwords, secrets, secrets-management, secrets-manager, variables
- Language: Go
- Homepage:
- Size: 177 KB
- Stars: 38
- Watchers: 4
- Forks: 2
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
envy
====
Use `envy` to manage sensitive environment variables when running commands.
[](https://opensource.org/licenses/MIT)
[](https://github.com/shoenig/envy/actions/workflows/ci.yaml)
# Project Overview
`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](https://github.com/sorah/envchain) and [schain](https://github.com/evanphx/schain).
It makes use of the [go-keyring](https://github.com/zalando/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](https://github.com/etcd-io/bbolt).
Supports **Linux**, **macOS**, and **Windows**
# Getting Started
#### Install
The `envy` command is available to download from the [Releases](https://github.com/shoenig/envy/releases) page.
Multiple operating systems and architectures are supported, including
- Linux
- macOS
- Windows
#### Install from Go module
The `envy` command can be installed from source by running
```bash
$ go install github.com/shoenig/envy@latest
```
# Example Usages
#### usage overview
```bash
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
```
#### create/update a profile
```bash
$ envy set example FOO=1 BAR=2 BAZ=3
```
#### update existing variable in a profile
```bash
$ envy set example FOO=4
```
#### remove variable from profile
```bash
$ envy set example -FOO
```
#### execute command
```bash
$ envy exec example env
BAR=2
BAZ=3
... ...
```
#### execute command excluding external environment
```bash
$ envy exec --insulate example env
BAR=2
BAZ=3
```
Note that `-i` is short for `--insulate`.
#### execute command including extra variables
```bash
$ envy exec --insulate example EXTRA=value env
EXTRA=value
BAR=2
BAZ-3
```
#### list available profiles
```bash
$ envy list
consul/connect-acls:no_tls
example
nomad/e2e
test
```
#### show variables in a profile
```bash
$ envy show test
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
```
#### show profile variables w/ values
```bash
$ envy show --unveil test
AWS_ACCESS_KEY_ID=aaabbbccc
AWS_SECRET_ACCESS_KEY=233kjsdf309jfsd
```
Note that `-u` is short for `--unveil`.
#### delete profile
```bash
$ envy purge test
purged profile "test"
```
# Contributing
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.
# LICENSE
The `github.com/shoenig/envy` module is open source under the [MIT](LICENSE) license.