Back to Chezmoi

Bitwarden functions

assets/chezmoi.io/docs/reference/templates/bitwarden-functions/index.md

2.70.21.3 KB
Original Source

Bitwarden functions

The bitwarden* and rbw* functions return data from Bitwarden using the Bitwarden CLI (bw), Bitwarden Secrets CLI (bws), and rbw commands.

Automatic Bitwarden CLI unlock

By default, you must have unlocked your Bitwarden CLI session with the command

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

before running chezmoi.

Optionally, you can tell chezmoi to automatically run bw unlock --raw and set the BW_SESSION environment variable by setting the bitwarden.unlock configuration variable. Valid values are:

ValueEffect
falseNever run bw unlock --raw automatically.
trueAlways run bw unlock --raw automatically.
"auto"Only run bw unlock --raw if the BW_SESSION environment variable is not set.

Additionally, if chezmoi runs bw unlock raw automatically, then chezmoi will also run bw lock before terminating.