Getting started with 1Password for your growing team, or refining your setup? Our Secured Success quickstart guide is for you.
Forum Discussion
Former Member
4 years ago[69] combine new CLI with direnv or similar tools?
Currently, I use a tool called https://direnv.net/ to set environment variables when I enter a directory in my terminal.
here's what I would like to achieve:
Have an .envrc file in my directo...
Former Member
4 years agoHi,
You might be interested in https://1password.community/discussion/126437/16-17-20-37-38-support-for-both-versions-in-scripts about direnv (although mostly for supporting both v1 and v2). There is also a link to my PoC direnv extension.
I think the hard part is to come up with a good user interface.
It could be possible to trigger op run
for all variables at the end of .envrc
evaluation, but I'm not sure if it's good to unconditionally always run op
(with the need to authenticate). And also someone might not be happy to feed all their variables to 1Password CLI.
How about adding e.g. use op
direnv stdlib command (with an extension), which would trigger the evaluation at the end? Although that might require a bit of hacking or changes in direnv, as there are no support for this kind of post evaluation hooks as far as I know. But we could test if we can hijack the EXIT trap for the first test.