LinuxCommandLibrary

bw

Bitwarden password manager CLI

TLDR

Login to Bitwarden

$ bw login
copy
Unlock vault
$ bw unlock
copy
List items
$ bw list items
copy
Get password
$ bw get password [example.com]
copy
Create item
$ bw create item
copy
Sync vault
$ bw sync
copy

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 account
unlock
Unlock vault (returns session key)
lock
Lock vault
sync
Sync vault with server
list object
List items, folders, collections
get object id
Get specific item
create object encodedJson
Create new item
edit object id encodedJson
Edit existing item
delete object id
Delete item

WORKFLOW

$ # Login
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
copy

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.

SEE ALSO

pass(1), gopass(1), 1password(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community