qmetrics.net

direnv

Per-directory environment loading for your shell

direnv screenshot

direnv hooks into bash, zsh, fish, and other shells to load or unload environment variables when you enter or leave a directory. Project settings live in `.envrc` files instead of global profiles.

Overview

direnv extends an existing shell so environment variables change with your current working directory. Before each prompt it looks for `.envrc` and optionally `.env` files in the directory tree; after you authorize a file, exported variables from a bash subshell are applied to your interactive session.

Typical uses include isolated per-project dev environments, loading deployment secrets, and injecting twelve-factor style configuration without editing `~/.profile`. Hooks exist for common shells including bash, zsh, tcsh, fish, and several newer shells.

The binary is a single static executable intended to add negligible overhead on each prompt. It is language-agnostic and can underpin directory-based version managers similar to pyenv or rbenv patterns.

A standard library of helper functions ships with `.envrc` execution, such as `PATH_add` for safe path prepends. You can extend behavior with personal `direnvrc` files under your config directory, and combine `.envrc` with dotenv-style `.env` files when both are needed.

Key features

  • Automatic directory-based env load
  • Authorized `.envrc` execution
  • Multi-shell hook support
  • Fast static single binary
  • Built-in stdlib helpers
  • Custom extensions via direnvrc
  • Optional `.env` dotenv pairing
  • Language-agnostic project envs

Use cases

  • Per-project toolchain paths
  • Loading API keys for deploys
  • Isolating language runtimes
  • Twelve-factor app variables
  • Keeping global profiles minimal

Tags

Similar software

NVM

Node.js version manager for Windows

NVM for Windows installs and switches Node.js versions on Windows without mandatory administrator rights. It is a separate project from the Mac and Linux nvm tool.

★ 48.3k⟳ 2 days agoMIT
Build & DeploymentDesktop/CLI app

Pyenv

Per-user Python version switcher and installer

Pyenv installs multiple Python interpreters and selects global, directory-local, or shell-specific versions. It uses PATH shims instead of loading into the shell.

★ 45.2k⟳ todayMIT
Build & DeploymentDesktop/CLI app

mise-en-place

CLI for project dev tools, env vars, and tasks

mise coordinates development tool versions, environment variables, and project tasks from a single config that works in your shell, editor, and CI.

★ 36.6k⟳ 2 days agoMIT
Build & DeploymentDesktop/CLI app

fnm

Cross-platform Node.js version manager in Rust

fnm installs and switches Node.js runtimes on your machine from the shell. It ships as a single binary, starts quickly, and reads project pins from .node-version and .nvmrc files.

★ 27.5k⟳ 1 month agoGPL-3.0
Build & DeploymentDesktop/CLI app

Distrobox

Host-integrated Linux distribution environments in your terminal

Distrobox wraps Podman, Docker, or Lilipod to run another Linux distro userland tightly linked to your host home, graphics, and devices.

★ 13.1k⟳ yesterdayGPL-3.0
Build & DeploymentDesktop/CLI app

WP-CLI

Command-line interface for administering WordPress sites

WP-CLI exposes WordPress dashboard actions and extra maintenance tasks from the shell. Install the phar, then run wp commands against a WordPress installation.

★ 5.2k⟳ todayMIT
Build & DeploymentDesktop/CLI app