I would love it if I could just use my Mac's Keychain Access from the command line
Create a DB in MacOS keychain called envs:
security create-keychain -P envs
Then use these shell functions: which get-env
get-env () {
security find-generic-password -s "$1" -w envs
}
which add-env
add-env () {
security add-generic-password -a "$USER" -s "$1" -w "$2" envs
}
Then add one via: add-env ENVNAME SECRET
Example using it: ENVVAR=“$(get-env ENVNAME)” ./script.shI've got something of a wrapper script at https://github.com/bbkane/dotfiles/blob/8573e44d0f9fb5ddcbdc...
Its getting a bit too unwieldy to stay as a single Python file and add tests and features, so I'm rewriting it in Go (nothing useful yet though)