direnv library to load secrets from 1Password
- Version 2 of direnv
- Version 2 of the 1Password CLI.
make installFor any directory where you need 1Password secrets to be injected using
direnv, add the following to your .envrc file:
use oprcCreate a .oprc file in the same directory with the list of 1Password items
you need injected:
cat >.oprc <<EOT
export A_SECRET="op://Vault/Item/credential"
export ANOTHER_SECRET="op://Vault/Another Item/credential"
EOTYou can use op item get "Item Name" --format json to get the reference for a
secret.
See Also: