#secret #bitwarden #manage #command #object #tool #session

app bitwarden-secrets

A simple command line tool to manage Bitwarden secrets

3 releases (breaking)

0.3.0 May 29, 2024
0.2.0 May 29, 2024
0.1.0 May 29, 2024

#566 in Command line utilities

Download history 302/week @ 2024-05-25 36/week @ 2024-06-01 9/week @ 2024-06-08 1/week @ 2024-06-15

59 downloads per month


228 lines

Bitwarden secrets

CLI to help to manage secrets for shell session or code compilation.


cargo install bitwarden-secrets


Create a .bw-secrets.json secrets file in the directory where you want to use the secrets (or a parent directory) with the following content:

  "01234567-8901-2345-6789-012345678900": {
    "object": "password",
    "name": "NPM_TOKEN"
  "01234567-8901-2345-6789-012345678900": {
    "object": "password",
    "name": "CARGO_TOKEN"

The keys are the IDs of the secrets in Bitwarden. Object is the type of the secret (username, password, totp, uri or notes) and name is the name of the environment variable that will be set with the secret value.


The CLI can not create the environment variables directly in the shell session, but it can output the commands to do so. Then, you can run the output in the shell to set the environment variables:


iex (bw-secrets | Out-String)


source <(bw-secrets)


~101K SLoC