After installing direnv with homebrew you’ll need to run a command to hook direnv into your shell. This information is not present in the current direnv recipe which could make people get confused because direnv doesn’t work “out of the box”.
The command that needs to be run to finish the installation can be found at https://direnv.net/docs/hook.md and varies depending on the shell you use (i.e. bash, zsh, fish, etc).
The instructions look like this:
# Setup For direnv to work properly it needs to be hooked into the shell. Each shell has its own extension mechanism. Once the hook is configured, restart your shell for direnv to be activated. ## BASH Add the following line at the end of the `~/.bashrc` file: ```sh eval "$(direnv hook bash)" ``` Make sure it appears even after rvm, git-prompt and other shell extensions that manipulate the prompt. ## ZSH Add the following line at the end of the `~/.zshrc` file: ```sh eval "$(direnv hook zsh)" ``` ## FISH Add the following line at the end of the `~/.config/fish/config.fish` file: ```fish direnv hook fish | source ```
I created a PR adding a message to the caveats section pointing to the instructions page from direnv but it was rejected because
Read the manual isn’t really a homebrew specific instruction
Should we simply copy and paste the content of the instruction page to the caveats?
Is there another section where we can include this information?