direnv is pretty old by computer standard and it's still weird for me to see it pop-up from time to time. I wrote this tool for myself and it's amazing to see it being useful to others.
Do you think Direnv is obsoleted by something else? I’ve always preferred to have an environment specific to my working directory…I seem to recall setting up similar tools for my workstations and network profiles in the 90’s. Seems like a perfectly reasonable way to work.
The next evolution is something that also sandboxes the project. A random npm library that gets installed shouldn't be allowed to access anything other than your project root.
But it also has to be fast and convenient. Docker is still too slow to fill that role.
I think I’ll put Direnv on my todo list and consider not using Autoenv any more. I like the way it’s able to unroll the environment, though the equivalent is possible by e.g. starting a new login shell. Is it time to stop using Bash as my interactive shell? I didn’t even realize MacOS had gone all zsh/sh on me because I long ago installed an up-to-date Bash so as not to curse so much...I enjoy my Macs but I’m starting to get all container-loving, unikernel affectionate, functions-as-a-service-friendly, commodity-hardware grasping. And there’s the constant undercurrent of Nix envy my subconscious surfaces occasionally...
I'm not sure if it's obvious but direnv also works with zsh. It's loading the .envrc with bash, then capturing the env diff, and reflecting that back to the host shell.
direnv is still back-compat with macOS's bash 3.x, although the limitation so becoming increasingly frustrating. Bash 3.x is 10y+ old at this point and it would be nice to be able to use associative arrary finally.
I discovered direnv a couple of months ago and put it to work automatically switching AWS profiles. Now, when I work on CloudFormation templates for each of my AWS accounts I don't have to manually copy & paste ENVARs anymore. Thanks to direnv I just have to cd into the proper directory and BAM I have the proper credentials.
direnv is pretty old by computer standard and it's still weird for me to see it pop-up from time to time. I wrote this tool for myself and it's amazing to see it being useful to others.
Feel free to ask me anything.