bw
Bitwarden password manager CLI
TLDR
Login to Bitwarden
SYNOPSIS
bw command [options]
DESCRIPTION
bw is the official command-line interface for Bitwarden, an open-source password manager. It enables accessing and managing passwords, notes, and credentials from the terminal or in scripts.
The tool provides full access to Bitwarden vaults for automation and integration purposes.
PARAMETERS
--session key
Session key for authentication--organizationid id
Organization ID filter--pretty
Pretty-print JSON output--raw
Return raw value only
COMMON COMMANDS
login [email]
Log in to accountunlock
Unlock vault (returns session key)lock
Lock vaultsync
Sync vault with serverlist object
List items, folders, collectionsget object id
Get specific itemcreate object encodedJson
Create new itemedit object id encodedJson
Edit existing itemdelete object id
Delete item
WORKFLOW
bw login user@example.com
# Unlock vault (save session key)
export BW_SESSION="$(bw unlock --raw)"
# List all items
bw list items
# Get password
bw get password github.com
# Search items
bw list items --search "google"
# Get username
bw get username amazon.com
# Generate password
bw generate -ulns --length 20
# Create item
echo '{"name":"My Login","username":"user","password":"pass"}' | \
bw encode | bw create item
FEATURES
- Full vault access
- Password generation
- Secure note storage
- Two-factor authentication
- Organization support
- Self-hosted server support
- JSON output for scripting
CAVEATS
Session key needed for most operations. Store session key securely (environment variable). Output is JSON (requires parsing). CLI requires unlocking frequently. Self-hosted servers need configuration.
HISTORY
Bitwarden CLI was released around 2018 as part of the Bitwarden password manager to enable terminal and scripting access.
