
Directory-based environment loader
Free

direnv is a shell extension that automatically loads and unloads environment variables based on the current directory. It simplifies environment management by reading a .envrc file (and optionally .env) in the project directory. This file contains shell commands that set environment variables. direnv integrates with various shells like bash, zsh, tcsh, and fish. It's designed to be fast and unobtrusive, making it ideal for managing project-specific configurations without cluttering your shell profile. It supports hooks for all common shells and is language-agnostic, suitable for building solutions similar to rbenv, pyenv, and phpenv. direnv is a single static executable, ensuring minimal performance impact.
Loads and unloads environment variables based on directory changes.
Supports bash, zsh, tcsh, fish, and other shells.
Allows for per-project environment settings.
Requires explicit authorization for `.envrc` files.
Compiled into a single static executable for speed.
Can be used with any programming language or project.
Install direnv on your system (package managers are available).,Hook direnv into your shell (instructions vary by shell).,Navigate to your project directory.,Create a .envrc file in your project root.,Add environment variable export commands to .envrc (e.g., export MY_VARIABLE=value).,Run direnv allow in the project directory to authorize the .envrc file.
Easily manage environment variables required by 12-factor applications.
Create project-specific environments to avoid conflicts.
Load sensitive information (API keys, passwords) securely.
Configure environment variables for different deployment stages.
Software developers who need to manage environment variables for their projects.
Engineers who need to manage and automate environment configuration.
direnv is open-source and free to use.