Skip to content

Instantly share code, notes, and snippets.

@epcim
Created April 1, 2026 05:44
Show Gist options
  • Select an option

  • Save epcim/479188c2a98468ed9c0187386a54e23a to your computer and use it in GitHub Desktop.

Select an option

Save epcim/479188c2a98468ed9c0187386a54e23a to your computer and use it in GitHub Desktop.
keyring, secrets management and CLI
# gopass
EDITOR=vi gopass insert me/api/xyz_api_key
XYZ_API_KEY="$(gopass -o me/api/xyz_api_key)"
# python
python -m keyring set XYZ_API_KEY <username>
python -m keyring get XYZ_API_KEY <username>
# MacOS
get_secret() {
security find-generic-password -a "$USER" -s "$1" -w
}
export XYZ_API_KEY=$(get_secret XYZ_API_KEY)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment