Installation
Prerequisites
Section titled “Prerequisites”bwenv requires two things:
| Tool | Why | Install link |
|---|---|---|
| direnv | Automatically loads/unloads env vars when you cd into a directory | direnv.net |
| Password manager CLI (at least one) | Fetches secrets from your vault | See below |
Password Manager CLIs
Section titled “Password Manager CLIs”| Provider | CLI | Install link |
|---|---|---|
| Bitwarden | bw | bitwarden.com/help/cli |
| 1Password | op | developer.1password.com/docs/cli |
No
jqneeded. bwenv v2 is a single Go binary — no extra dependencies.
Install bwenv
Section titled “Install bwenv”Quick Install (Recommended)
Section titled “Quick Install (Recommended)”macOS / Linux — one-line install via curl:
curl -fsSL https://raw.githubusercontent.com/s1ks1/bwenv/main/install.sh | shOr with wget:
wget -qO- https://raw.githubusercontent.com/s1ks1/bwenv/main/install.sh | shWindows — one-line install via PowerShell:
irm https://raw.githubusercontent.com/s1ks1/bwenv/main/install.ps1 | iexBoth scripts auto-detect your OS and architecture, download the latest release, verify checksums, and install to
~/.local/bin.
Homebrew (macOS / Linux)
Section titled “Homebrew (macOS / Linux)”brew tap s1ks1/bwenvbrew install bwenvScoop (Windows)
Section titled “Scoop (Windows)”scoop bucket add bwenv https://github.com/s1ks1/scoop-bwenvscoop install bwenvGo Install
Section titled “Go Install”go install github.com/s1ks1/bwenv@latestRequires Go 1.22+.
From Source
Section titled “From Source”git clone https://github.com/s1ks1/bwenv.gitcd bwenvmake install # Builds and installs to ~/.local/binDirect Download
Section titled “Direct Download”Download the latest binary for your platform from the Releases page, extract it, and place bwenv somewhere in your PATH.
Post-Install Setup
Section titled “Post-Install Setup”Configure direnv Hook
Section titled “Configure direnv Hook”direnv needs to be hooked into your shell. This is a one-time setup.
Bash — add to ~/.bashrc:
eval "$(direnv hook bash)"Zsh — add to ~/.zshrc:
eval "$(direnv hook zsh)"Fish — add to ~/.config/fish/config.fish:
direnv hook fish | sourcePowerShell — add to $PROFILE:
Invoke-Expression "$(direnv hook pwsh)"After adding the hook, restart your terminal or source your shell config.
Verify Installation
Section titled “Verify Installation”bwenv statusThis shows:
- Whether direnv is installed and its hook is configured
- Which password manager CLIs are available
- Current session states
- Configuration preferences
Platform-Specific Notes
Section titled “Platform-Specific Notes”# Install all prerequisites at oncebrew install direnvbrew install bitwarden-cli # Bitwardenbrew install --cask 1password-cli # 1Password
# Install bwenvbrew tap s1ks1/bwenvbrew install bwenvLinux (Ubuntu/Debian)
Section titled “Linux (Ubuntu/Debian)”sudo apt update && sudo apt install -y direnv
# Bitwarden CLIsudo snap install bw
# 1Password CLI (optional)curl -sS https://downloads.1password.com/linux/keys/1password.asc | \ sudo gpg --dearmor --output /usr/share/keyrings/1password-archive-keyring.gpgecho "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/$(dpkg --print-architecture) stable main" | \ sudo tee /etc/apt/sources.list.d/1password.listsudo apt update && sudo apt install -y 1password-cli
# Install bwenvgo install github.com/s1ks1/bwenv@latestWindows
Section titled “Windows”# Using Scoop (recommended)scoop install direnvscoop install bitwarden-cli # or: scoop install 1password-cliscoop bucket add bwenv https://github.com/s1ks1/scoop-bwenvscoop install bwenvTroubleshooting
Section titled “Troubleshooting”bwenv not found
Section titled “bwenv not found”Make sure the install directory is in your PATH:
# If installed via go install:export PATH="$HOME/go/bin:$PATH"
# If installed via make install or curl installer:export PATH="$HOME/.local/bin:$PATH"direnv not activating
Section titled “direnv not activating”Ensure the direnv hook is added to your shell config and you’ve restarted your terminal:
bwenv status # Check the "Dependencies" sectionPermission denied
Section titled “Permission denied”chmod +x ~/.local/bin/bwenvUninstall
Section titled “Uninstall”Homebrew
Section titled “Homebrew”brew uninstall bwenvbrew untap s1ks1/bwenvscoop uninstall bwenvscoop bucket rm bwenvGo install
Section titled “Go install”rm -f $(go env GOPATH)/bin/bwenvClean up config
Section titled “Clean up config”rm -rf ~/.config/bwenvRemove .envrc from projects
Section titled “Remove .envrc from projects”bwenv remove # In each project directory