Skip to content

bitwarden-cli

work with your bitwarden vault from the command line.

installation

brew install bitwarden-cli

use in scripts

to use bitwarden-cli in scripts, you can pass --raw to the unlock command and retrieve only the session token:

BW_SESSION=$(bw unlock --raw)
export BW_SESSION

unlock / lock

bw unlock
bw lock

you can also pass | jq to it since the output is in json

bw list items --search "dnscontrol"

get username / password

use the search from above, and take the id to get the username/password:

bw get username "foo-bar-random-id"
bw get password "foo-bar-random-id"