2025-06-18 23:13:55 +03:00
2025-06-18 22:53:38 +03:00
2025-06-18 22:53:38 +03:00
2025-06-18 23:13:55 +03:00

direnv-dotenvx

A simple direnv extension to automatically load environment variables from .env files using dotenvx.

📦 Installation

  1. Clone the repo somewhere:
mkdir -p ~/.config/direnv/lib
git clone https://github.com/chenasraf/direnv-dotenvx ~/.config/direnv/lib/direnv-dotenvx
  1. Symlink or source the loader:
ln -s ~/.config/direnv/lib/direnv-dotenvx/use_dotenvx.sh ~/.config/direnv/lib/use_dotenvx.sh

This makes the function use_dotenvx available in all .envrc files.

⚙️ Usage

In your .envrc:

use_dotenvx              # loads .env or .env.default
use_dotenvx dev          # loads .env.dev

Then run:

direnv allow

🔒 Security Note

direnv is sandboxed — only exported variables are applied to your environment. Be sure to review and trust your .env files before allowing them.

📝 License

MIT

Description
A direnv plugin to load .env or .env.{env} files using dotenvx, with automatic variable detection and shell-safe exports.
Readme MIT 42 KiB
Languages
Shell 100%