CLI Session Key

Hi everybody.

Just testing out the CLI and wondered if there is a command to request the current session key?!

Can anybody help?


I got my hands on my session key while logging in, with bw login. The key is printed in the console. I guess it is a manual process to save such a key into an environmental variable for your shell.

Upon setting up the environmental variable for BW_SESSION properly in .bashrc (or .zshrc if one uses Zsh), there is no further need of 2FA or master password verification. The documentation was specifically vague for the implication of setting up such env_var for a good reason, as “is not well-suited for persisting on an unprotected disk.” Ref: Source paragraph from the Doc

Though, I have to admit the following console output is not intuitive to understand:

? Email address: [email protected]
? Master password: [hidden]
? Two-step login code: xxxxxx
You are logged in!

To unlock your vault, set your session key to the `BW_SESSION` environment variable. ex:
$ export BW_SESSION="And_a_long_long_SECRETE_session_key"