I think it's a really useful tool. Doom emacs has it:
direnv: -
Save (or destroy) the environment at your leisure
This module integrates direnv into Emacs.
đź“Ś direnv is an environment switcher for the shell. It knows how to hook into bash, zsh, tcsh, fish shell and elvish to load or unload environment variables depending on the current directory. This allows project-specific environment variables without cluttering the ~/.profile file.
Before each prompt, direnv checks for the existence of a “.envrc” file in the current and parent directories. If the file exists (and is authorized), it is loaded into a bash sub-shell and all exported variables are then captured by direnv and then made available to the current shell.
So far, i have seen this plugin:
https://github.com/direnv/direnv.vim
I think it's a really useful tool. Doom emacs has it: