-
Notifications
You must be signed in to change notification settings - Fork 87
PluginBitwarden
Display Bitwarden vault status with interactive password and TOTP selectors for secure credential management.
Locked
Unlocked
Logged Out
| Property | Value |
|---|---|
| Platform | macOS, Linux |
| Dependencies |
bw (Bitwarden CLI) or rbw (unofficial Rust client) |
| Content Type | dynamic |
| Presence | conditional (hidden when unauthenticated, or when locked if show_only_when_unlocked is enabled) |
# Official Bitwarden CLI
# macOS
brew install bitwarden-cli
# Linux (npm)
npm install -g @bitwarden/cli
# Unofficial Rust client (faster)
cargo install rbw
# Login (official CLI)
bw login
# Unlock vault
bw unlock# Add to your tmux configuration
set -g @powerkit_plugins "bitwarden"
# Set keybindings
set -g @powerkit_plugin_bitwarden_keybinding_password "C-v"
set -g @powerkit_plugin_bitwarden_keybinding_totp "C-t"
set -g @powerkit_plugin_bitwarden_keybinding_unlock "C-w"
# Reload tmux configuration
tmux source-file ~/.tmux.confset -g @powerkit_plugins "bitwarden"
# Cache (higher TTL because bw status is slow ~1.5s)
set -g @powerkit_plugin_bitwarden_cache_ttl "60"
# Icons
set -g @powerkit_plugin_bitwarden_icon ""
set -g @powerkit_plugin_bitwarden_icon_locked ""
set -g @powerkit_plugin_bitwarden_icon_unlocked ""
set -g @powerkit_plugin_bitwarden_icon_unauthenticated ""
# Keybindings
set -g @powerkit_plugin_bitwarden_keybinding_password "C-v"
set -g @powerkit_plugin_bitwarden_keybinding_totp "C-t"
set -g @powerkit_plugin_bitwarden_keybinding_unlock "C-w"
set -g @powerkit_plugin_bitwarden_keybinding_lock ""
# Popup dimensions
set -g @powerkit_plugin_bitwarden_popup_width "60%"
set -g @powerkit_plugin_bitwarden_popup_height "80%"
set -g @powerkit_plugin_bitwarden_popup_unlock_width "40%"
set -g @powerkit_plugin_bitwarden_popup_unlock_height "30%"| Option | Type | Default | Description |
|---|---|---|---|
@powerkit_plugin_bitwarden_show_only_when_unlocked |
bool | false |
Only show plugin when vault is unlocked |
@powerkit_plugin_bitwarden_cache_ttl |
number | 60 |
Cache duration (bw status is slow) |
@powerkit_plugin_bitwarden_icon |
icon | |
Default icon |
@powerkit_plugin_bitwarden_icon_locked |
icon | |
Locked vault icon |
@powerkit_plugin_bitwarden_icon_unlocked |
icon | |
Unlocked vault icon |
@powerkit_plugin_bitwarden_icon_unauthenticated |
icon | |
Logged out icon |
@powerkit_plugin_bitwarden_keybinding_password |
key | C-v |
Password selector keybinding |
@powerkit_plugin_bitwarden_keybinding_totp |
key | C-t |
TOTP selector keybinding |
@powerkit_plugin_bitwarden_keybinding_unlock |
key | C-w |
Unlock vault keybinding |
@powerkit_plugin_bitwarden_keybinding_lock |
key | `` | Lock vault keybinding |
@powerkit_plugin_bitwarden_popup_width |
string | 60% |
Password/TOTP popup width |
@powerkit_plugin_bitwarden_popup_height |
string | 80% |
Password/TOTP popup height |
@powerkit_plugin_bitwarden_popup_unlock_width |
string | 40% |
Unlock popup width |
@powerkit_plugin_bitwarden_popup_unlock_height |
string | 30% |
Unlock popup height |
| State | Condition |
|---|---|
active |
Vault is locked or unlocked (logged in) |
inactive |
Not logged in (unauthenticated), or locked when show_only_when_unlocked is enabled |
Note: With
show_only_when_unlockedenabled, the plugin is only visible when the vault is unlocked. This is useful for a cleaner status bar when you don't need to see the "Locked" status.
| Level | Condition |
|---|---|
good |
Vault is unlocked |
warning |
Vault is locked |
error |
Not logged in (unauthenticated) |
| Context | Description |
|---|---|
unlocked |
Vault is unlocked and accessible |
locked |
Vault is locked, master password required |
unauthenticated |
Not logged in, credentials required |
set -g @powerkit_plugins "bitwarden"
set -g @powerkit_plugin_bitwarden_keybinding_password "C-v"set -g @powerkit_plugins "bitwarden"
set -g @powerkit_plugin_bitwarden_keybinding_password "C-v"
set -g @powerkit_plugin_bitwarden_keybinding_totp "C-t"
set -g @powerkit_plugin_bitwarden_keybinding_unlock "C-w"
set -g @powerkit_plugin_bitwarden_keybinding_lock "C-l"set -g @powerkit_plugins "bitwarden"
set -g @powerkit_plugin_bitwarden_popup_width "80%"
set -g @powerkit_plugin_bitwarden_popup_height "90%"set -g @powerkit_plugins "bitwarden"
set -g @powerkit_plugin_bitwarden_cache_ttl "30"Hide the plugin when the vault is locked (only show when unlocked):
set -g @powerkit_plugins "bitwarden"
set -g @powerkit_plugin_bitwarden_show_only_when_unlocked "true"| Action | Default Key | Description |
|---|---|---|
| Password Selector | prefix + C-v |
Search and copy password to clipboard |
| TOTP Selector | prefix + C-t |
Search and copy TOTP code to clipboard |
| Unlock Vault | prefix + C-w |
Unlock vault with master password |
| Lock Vault | (not bound) | Lock vault |
- Install Bitwarden CLI
- Login:
bw login - Unlock:
bw unlock - Export session token to tmux:
tmux setenv -g BW_SESSION "your-session-token"
- Press
prefix + C-v - Search for item (fuzzy search with fzf)
- Select item
- Password is copied to clipboard
- Notification shown in tmux
- Press
prefix + C-t - Search for item with TOTP enabled
- Select item
- TOTP code is copied to clipboard
- Notification shown with code and countdown
- Press
prefix + C-w - Enter master password
- Vault unlocks and session token stored
- Plugin status updates to "Unlocked"
The plugin supports both official and unofficial Bitwarden clients:
| Client | Command | Speed | Notes |
|---|---|---|---|
| Official CLI | bw |
Slow (~1.5s) | Full feature support |
| Unofficial Rust | rbw |
Fast (~100ms) | Faster, limited features |
The plugin automatically detects which client is available and prefers bw if both are installed.
The plugin reads BW_SESSION from tmux environment:
# After unlocking, store session in tmux
bw unlock
# Copy the session token shown
tmux setenv -g BW_SESSION "your-session-token"
# Verify session is stored
tmux showenv -g BW_SESSIONFor rbw, session management is handled automatically by the client.
-
Verify login status:
bw status
-
Check if BW_SESSION is set:
tmux showenv -g BW_SESSION
-
Unlock vault and set session:
BW_SESSION=$(bw unlock --raw) tmux setenv -g BW_SESSION "$BW_SESSION"
-
Verify fzf is installed:
which fzf
-
Check if vault is unlocked:
bw list items
-
Test helper script manually:
bash ~/.config/tmux/plugins/tmux-powerkit/src/helpers/bitwarden_password_selector.sh select
-
Verify items have TOTP configured in Bitwarden
-
Check if
jqis installed (optional but recommended):which jq
-
Test TOTP helper:
bash ~/.config/tmux/plugins/tmux-powerkit/src/helpers/bitwarden_totp_selector.sh select
The official bw CLI is slow (~1.5s per call). To improve performance:
-
Use
rbwinstead:cargo install rbw rbw register rbw login
-
Increase cache TTL:
set -g @powerkit_plugin_bitwarden_cache_ttl "120"
Check for conflicts with other plugins:
prefix + C-y # View all keybindingsIf conflicts exist, change the keybinding:
set -g @powerkit_plugin_bitwarden_keybinding_password "C-b"- Session tokens are stored in tmux environment variables
- Passwords are copied to clipboard and cleared after use
- The plugin never logs passwords or TOTP codes
- Cache stores only vault status (locked/unlocked), not credentials
- Helper scripts use temporary files that are cleaned up automatically
The plugin uses three helper scripts:
-
bitwarden_password_selector.sh
- Search and copy passwords
- Handles vault unlocking
- Actions:
select,unlock,lock
-
bitwarden_totp_selector.sh
- Search and copy TOTP codes
- Shows countdown timer
- Actions:
select
-
bitwarden_common.sh
- Shared utilities
- Session management
- Item parsing
- PluginSmartkey - Display custom environment variables
- PluginGit - Git repository status