Getting started with 1Password for your growing team, or refining your setup? Our Secured Success quickstart guide is for you.
Forum Discussion
jc00ke
4 years agoOccasional Contributor
Secret reference syntax usable by direnv?
I see on docs/cli/secrets-environment-variables that I can op run -- myapp start but what if I wanted to load secret values via direnv? I don't see anything in the direnv-stdlib and was wondering i...
Former Member
3 years agoThis might not be exactly what you were looking for, jc00ke, but it may be adjacent and potentially useful.
Given a "secure note" in 1password, named "Example - Direnv", stored in a vault named "Private", and with the following content:
export DIRENV_OVER_1PASSWORD="success"
and a .envrc
file in a project, with the following content:
$(op item get 'Example - Direnv' --fields label=text | xargs echo)
or:
$(op read 'op://Private/Example - Direnv/text')
I found that, assuming you've already done a eval $(op signin)
, the following works:
$ echo $DIRENV_OVER_1PASSWORD
"success"
Also, hi Jesse!