No description
  • Shell 77.6%
  • Python 22.4%
Find a file
2026-04-20 15:23:00 +02:00
bin feat: improve tmux picker responsiveness 2026-04-20 15:23:00 +02:00
docs feat: add bw-zsh zsh and tmux integration 2026-04-20 14:29:08 +02:00
lib feat: improve tmux picker responsiveness 2026-04-20 15:23:00 +02:00
tests feat: improve tmux picker responsiveness 2026-04-20 15:23:00 +02:00
.gitignore feat: add bw-zsh zsh and tmux integration 2026-04-20 14:29:08 +02:00
bootstrap.sh docs: add bootstrap one-liner installer 2026-04-20 14:36:55 +02:00
install.sh feat: add bw-zsh zsh and tmux integration 2026-04-20 14:29:08 +02:00
README.md docs: add bootstrap one-liner installer 2026-04-20 14:36:55 +02:00

bw-zsh

Bitwarden/Vaultwarden helpers for zsh and tmux with an interactive, colored installer.

One-liner install:

curl -fsSL https://git.brznet.fr/brz/bw-zsh/raw/branch/main/bootstrap.sh | bash

Features:

  • self-hosted Vaultwarden/Bitwarden or Bitwarden cloud configuration
  • proxy mode selection: off, keep, or custom
  • configurable zsh keybinding for the picker
  • tmux module that works while you are inside SSH sessions
  • automatic dependency installation when possible
  • login email saved in GNOME Keyring with secret-tool
  • bw-session-start / bw-session-stop
  • local bw serve for the session
  • fzf picker for password, username, combined insert, or TOTP

Files:

  • lib/bw-zsh.zsh: zsh functions, aliases, keybinding, proxy/server logic
  • bin/bw-fzf-select: shared local picker helper
  • bin/bw-tmux-picker: tmux-aware picker that pastes into the active pane
  • install.sh: colored CLI installer

Install interactively:

cd ~/dev/bw-zsh
./install.sh
exec zsh

Install non-interactively:

./install.sh \
  --non-interactive \
  --server-type self-hosted \
  --server-url https://vault.example.test \
  --proxy-mode off \
  --bindkey '^X^B' \
  --tmux-mode popup \
  --tmux-key M-b

Important installer flags:

  • --server-type self-hosted|cloud
  • --server-url URL
  • --proxy-mode off|keep|custom
  • --proxy-url URL
  • --bindkey KEYSEQ
  • --serve-port PORT
  • --tmux-mode off|popup|split
  • --tmux-key KEY
  • --bw-bin PATH
  • --install-deps
  • --skip-install-deps
  • --non-interactive

Dependency handling:

  • installs missing system dependencies with pacman, apt-get, or dnf when available
  • installs the Bitwarden CLI with npm --prefix ~/.local if bw is missing
  • installs tmux automatically when tmux mode is enabled and the package manager is supported

Commands after install:

  • bw-login-email-set [email]
  • bw-login-email-show
  • bw-login-email-clear
  • bw-session-start
  • bw-session-stop
  • bw-tmux-sync
  • bw-tmux-clear

Picker usage:

  • zsh: press the configured bindkey, default Ctrl-X Ctrl-B
  • tmux: press the configured tmux key, default M-b
  • Enter => password
  • Ctrl-U => username
  • Ctrl-B => username + password
  • Ctrl-T => TOTP

tmux behavior:

  • popup: opens a tmux popup, runs the picker locally, pastes the selected value into the current pane
  • split: opens a temporary split pane for the picker, then pastes into the original pane
  • this works even when the active pane is an SSH session, because tmux captures the shortcut locally
  • when bw-session-start runs and a tmux server exists, the current BW_SESSION is synced automatically into tmux
  • if you unlocked Bitwarden outside tmux first, run bw-tmux-sync to push the current session into tmux manually

Managed config blocks:

  • zsh block in ~/.zshrc between:
    • # >>> bw-zsh >>>
    • # <<< bw-zsh <<<
  • tmux block in ~/.tmux.conf between:
    • # >>> bw-zsh-tmux >>>
    • # <<< bw-zsh-tmux <<<

Generated config files:

  • ~/.config/bw-zsh/env.sh
  • ~/.config/bw-zsh/bw-zsh.zsh
  • ~/.config/bw-zsh/tmux.conf

After install:

exec zsh
tmux source-file ~/.tmux.conf