Versionv2.18.2
Revision54
Size1.3 MB
LicenseMIT
Confinementstrict
BaseUnknown

direnv -- Unclutter your .profile


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.

Because direnv is compiled into a single static executable, it is fast enough to be unnoticeable on each prompt. It is also language-agnostic and can be used to build solutions similar to rbenv, pyenv and phpenv.

Update History

v2.18.2 (54)
13 Dec 2025, 09:47 UTC

Published10 Dec 2018, 17:35 UTC

Last updated31 May 2019, 09:41 UTC

First seen13 Dec 2025, 09:47 UTC