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
Forever Free Full-Stack Observability | Grafana Cloud Icon
Forever Free Full-Stack Observability | Grafana Cloud

Our generous forever free tier includes the full platform, including the AI Assistant, for 3 users with 10k metrics, 50GB logs, and 50GB traces.

Built on open standards like Prometheus and OpenTelemetry, Grafana Cloud includes Kubernetes Monitoring, Application Observability, Incident Response, plus the AI-powered Grafana Assistant. Get started with our generous free tier today.
Create free account
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