Installing direnv on macOS
2024/03/07 (126 words)

Having had to install direnv multiple times over the last few days to get a team up and running im writing the method down because I keep having to look it up.

Install based on the following instructions Then hook it up to your shell via

Lastly to have it work with .env files create the following directory and file


and edit the contents to contain the following,


You will need to restart your shell after doing this. Opening a new terminal is the easiest way to do this.

You need to allow the .env file when you enter the directory, which will be prompted, but for reference the following is the command.

direnv allow .

Should do it for you.