Installation
Prerequisites
Section titled “Prerequisites”Before installing bwenv, ensure you have the following dependencies:
Required Dependencies
Section titled “Required Dependencies”-
Bitwarden CLI
Terminal window # Install via npm (recommended)npm install -g @bitwarden/cli# Install via Homebrew (macOS)brew install bitwarden-cli# Install via Scoop (Windows)scoop install main/bitwarden-cli# Install via Snap (Ubuntu/Debian)sudo snap install bw# Install via AUR (Arch Linux)sudo pacman -S bitwarden-cli# Or download from: https://bitwarden.com/help/cli/ -
direnv
Terminal window # macOS (Homebrew)brew install direnv# Windows (Scoop)scoop install main/direnv# Ubuntu/Debiansudo apt install direnv# Arch Linuxsudo pacman -S direnv# Or visit: https://direnv.net/docs/installation.html -
jq (JSON processor)
Terminal window # macOS (Homebrew)brew install jq# Windows (Scoop)scoop install main/jq# Ubuntu/Debiansudo apt install jq# Arch Linuxsudo pacman -S jq
Shell Integration (direnv)
Section titled “Shell Integration (direnv)”After installing direnv, add it to your shell:
# Bash - add to ~/.bashrceval "$(direnv hook bash)"
# Zsh - add to ~/.zshrceval "$(direnv hook zsh)"
# Fish - add to ~/.config/fish/config.fishdirenv hook fish | sourceInstallation Methods
Section titled “Installation Methods”Method 1: Quick Install (Recommended)
Section titled “Method 1: Quick Install (Recommended)”# Clone the repositorygit clone https://github.com/yourusername/bwenv.gitcd bwenv
# Install everythingmake installMethod 2: Manual Installation
Section titled “Method 2: Manual Installation”If you prefer manual setup:
# Clone and navigategit clone https://github.com/yourusername/bwenv.gitcd bwenv
# Create directoriesmkdir -p ~/.config/direnv/libmkdir -p ~/.local/bin
# Copy filescp setup/bitwarden_folders.sh ~/.config/direnv/lib/cp setup/bwenv ~/.local/bin/ # Unix/macOS# orcopy setup\bwenv.bat %USERPROFILE%\.local\bin\ # Windows
# Make executable (Unix/macOS)chmod +x ~/.local/bin/bwenvchmod +x ~/.config/direnv/lib/bitwarden_folders.shMethod 3: Platform-Specific
Section titled “Method 3: Platform-Specific”Linux/macOS
Section titled “Linux/macOS”make installmake setup-path # Automatically adds ~/.local/bin to PATHWindows
Section titled “Windows”make install# Manually add %USERPROFILE%\.local\bin to PATH environment variablePost-Installation Setup
Section titled “Post-Installation Setup”1. PATH Configuration
Section titled “1. PATH Configuration”Linux/macOS (Automatic)
Section titled “Linux/macOS (Automatic)”make setup-pathsource ~/.bashrc # or ~/.zshrcLinux/macOS (Manual)
Section titled “Linux/macOS (Manual)”Add to your shell config file (~/.bashrc, ~/.zshrc, etc.):
export PATH="$HOME/.local/bin:$PATH"Windows
Section titled “Windows”Add to PATH environment variable:
# PowerShell (as Administrator)$env:PATH += ";$env:USERPROFILE\.local\bin"[Environment]::SetEnvironmentVariable("PATH", $env:PATH, [EnvironmentVariableTarget]::User)2. Verify Installation
Section titled “2. Verify Installation”# Test all componentsbwenv test
# Check versionbwenv --version
# List available commandsmake helpTroubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”-
Command not found: bwenv
- Ensure
~/.local/binis in your PATH - Run
make setup-pathor add manually to shell config
- Ensure
-
Bitwarden CLI not working
- Install with:
npm install -g @bitwarden/cli - Login with:
bw login
- Install with:
-
direnv not activating
- Ensure direnv hook is added to your shell config
- Restart your terminal after adding the hook
-
Permission denied
- Make sure bwenv is executable:
chmod +x ~/.local/bin/bwenv
- Make sure bwenv is executable:
Getting Help
Section titled “Getting Help”# Show all make commandsmake help
# Test installationbwenv test
# Run with debug outputbwenv --debug=2 initUninstallation
Section titled “Uninstallation”To completely remove bwenv:
make uninstallThis removes:
- CLI executable from
~/.local/bin/bwenv - Helper script from
~/.config/direnv/lib/bitwarden_folders.sh
You may also want to remove the PATH modification from your shell config file.