A simple bash script to load environment variables from Bitwarden secure notes.
- Bitwarden CLI installed
- jq for JSON parsing
- Clone this repository:
git clone https://github.com/F2BEAR/bwem
cd bwem- Make the script executable:
chmod +x bwem.sh- Create a secure note in Bitwarden with your environment variables in
KEY=VALUEformat (one per line):
DB_HOST=localhost
DB_USER=admin
API_KEY=your-secret-key
- Load the variables into your current terminal session:
source bwem.sh <note-name>- The script will:
- Unlock your Bitwarden vault (if needed)
- Search for the specified note
- Export all variables to your current session
source bwem.sh "Production Secrets"The variables will remain available in your terminal until you close it or manually unset them.
To remove all loaded variables:
unset $(compgen -v | grep -E '^[A-Z_]+$')