Skip to content

Installation

bwenv requires two things:

ToolWhyInstall link
direnvAutomatically loads/unloads env vars when you cd into a directorydirenv.net
Password manager CLI (at least one)Fetches secrets from your vaultSee below
ProviderCLIInstall link
Bitwardenbwbitwarden.com/help/cli
1Passwordopdeveloper.1password.com/docs/cli

No jq needed. bwenv v2 is a single Go binary — no extra dependencies.

macOS / Linux — one-line install via curl:

Terminal window
curl -fsSL https://raw.githubusercontent.com/s1ks1/bwenv/main/install.sh | sh

Or with wget:

Terminal window
wget -qO- https://raw.githubusercontent.com/s1ks1/bwenv/main/install.sh | sh

Windows — one-line install via PowerShell:

Terminal window
irm https://raw.githubusercontent.com/s1ks1/bwenv/main/install.ps1 | iex

Both scripts auto-detect your OS and architecture, download the latest release, verify checksums, and install to ~/.local/bin.

Terminal window
brew tap s1ks1/bwenv
brew install bwenv
Terminal window
scoop bucket add bwenv https://github.com/s1ks1/scoop-bwenv
scoop install bwenv
Terminal window
go install github.com/s1ks1/bwenv@latest

Requires Go 1.22+.

Terminal window
git clone https://github.com/s1ks1/bwenv.git
cd bwenv
make install # Builds and installs to ~/.local/bin

Download the latest binary for your platform from the Releases page, extract it, and place bwenv somewhere in your PATH.

direnv needs to be hooked into your shell. This is a one-time setup.

Bash — add to ~/.bashrc:

Terminal window
eval "$(direnv hook bash)"

Zsh — add to ~/.zshrc:

Terminal window
eval "$(direnv hook zsh)"

Fish — add to ~/.config/fish/config.fish:

direnv hook fish | source

PowerShell — add to $PROFILE:

Terminal window
Invoke-Expression "$(direnv hook pwsh)"

After adding the hook, restart your terminal or source your shell config.

Terminal window
bwenv status

This shows:

  • Whether direnv is installed and its hook is configured
  • Which password manager CLIs are available
  • Current session states
  • Configuration preferences
Terminal window
# Install all prerequisites at once
brew install direnv
brew install bitwarden-cli # Bitwarden
brew install --cask 1password-cli # 1Password
# Install bwenv
brew tap s1ks1/bwenv
brew install bwenv
Terminal window
sudo apt update && sudo apt install -y direnv
# Bitwarden CLI
sudo 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.gpg
echo "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.list
sudo apt update && sudo apt install -y 1password-cli
# Install bwenv
go install github.com/s1ks1/bwenv@latest
Terminal window
# Using Scoop (recommended)
scoop install direnv
scoop install bitwarden-cli # or: scoop install 1password-cli
scoop bucket add bwenv https://github.com/s1ks1/scoop-bwenv
scoop install bwenv

Make sure the install directory is in your PATH:

Terminal window
# 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"

Ensure the direnv hook is added to your shell config and you’ve restarted your terminal:

Terminal window
bwenv status # Check the "Dependencies" section
Terminal window
chmod +x ~/.local/bin/bwenv
Terminal window
brew uninstall bwenv
brew untap s1ks1/bwenv
Terminal window
scoop uninstall bwenv
scoop bucket rm bwenv
Terminal window
rm -f $(go env GOPATH)/bin/bwenv
Terminal window
rm -rf ~/.config/bwenv
Terminal window
bwenv remove # In each project directory