Skip to content

Environment Variables for Other CLI Tools

Bernd Schoolmann edited this page Dec 28, 2023 · 1 revision
goldwarden_run_restic.webm

Goldwarden can inject environment variables into the environment of a cli command.

First, create a secure note in bitwarden, and add the following custom fields (using restic as an example):

custom-type: env
executable: name_of_executable
# env variables
AWS_ACCESS_KEY_ID: <your access key>
AWS_SECRET_ACCESS_KEY: <your secret key> (hidden)
RESTIC_PASSWORD: <your restic password> (hidden)
# optional
RESTIC_REPOSITORY: <your restic repository>
...

Then, run the command:

goldwarden run -- <command>

I.e

goldwarden run -- restic backup

You can also alias the commands, such that every time you run them, the environment variables are injected:

alias restic="goldwarden run -- restic"

And then just run the command as usual:

restic backup