direnv is an extension for your shell. It augments existing shells with a new feature that can load and unload environment variables depending on the current directory. Before each prompt, direnv checks for the existence of a .envrc or .env 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. If both .envrc and .env files exists, the .envrc will always be chosen first. It supports hooks for all the common shells like bash, zsh, tcsh and fish. This allows project-specific environment variables without cluttering the ~/.profile file. 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.

Features

  • Load 12factor apps environment variables
  • Create per-project isolated development environments
  • Load secrets for deployment
  • It supports hooks for all the common shells
  • Requires Unix-like operating system (macOS, Linux, …)
  • Requires a supported shell (bash, zsh, tcsh, fish, elvish)

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow direnv

direnv Web Site

Other Useful Business Software
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of direnv!

Additional Project Details

Operating Systems

Linux, Mac

Programming Language

Go

Related Categories

Go Software Development Software

Registered

2022-04-11