This script provides Git with Bitwarden credentials, and caches a session key on disk, revokable at any time running bw lock
.
It currently only implements the get
command.
Running this command will install the helper in either ~/.local/bin if it exists, otherwise with sudo in /usr/bin. It will also configure the helper to be used
curl -s https://raw.githubusercontent.com/AZMCode/git-credential-bw-shell/master/installer.sh | bash -s
- Download the git-credential-bw script somewhere in $PATH or $GIT_EXEC_PATH, and give it execute permissions
- Run
git config --add credential.helper bw
orgit config --global --add credential.helper bw
depending on whether you want the helper used globally or only in the current repository.
Within the script there are these variables, which can be used to configure the following things:
- Session Cache Filepath
- The program caches a session key in a file, this determines the path of it. Points to
/tmp/git-credential-bw.key
by default.
- The program caches a session key in a file, this determines the path of it. Points to
- Item Search String
- Bitwarden requires a search string to find the item that contains the login credentials for Git. Is
git
by default.
- Bitwarden requires a search string to find the item that contains the login credentials for Git. Is
- Maximum Attempts
- The program will attempt to get the credentials for a maximum of 3 times by default. This setting can change that. -1 results in the program never ceasing attempts.
Adriano Zambrana Marchetti
Licensed under GPLv3. See LICENSE file for more details