Protect what matters – even after you're gone. Make a plan for your digital legacy today.
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 ago@"Justin.Yoon_1P"
Ideally, I dont' want to actively run any commands manually but want my secrets to be resolved as soon as I cd into a directory. I understand thats very wishful thinking (and very lazy).
So in the case of direnv, I don't think the op shell command will work without further tweaks in the .envrc file. Whenever you cd into a directory with an .envrc file, direnv executes the .envrc file. While you can export variables, you can also put any arbitrary command there. If I put op shell in my .envrc, the shell will load again and because my .zshrc has the direnv hooks installed, it would see the .envrc, execute it, spawn a new shell, ... and so on.
I've run a quick test:
.envrc
$SHELL
result: