-
-
Save babibn/490914aab6092b96bec038319ccf1e6d to your computer and use it in GitHub Desktop.
Get passwords using the Bitwarden CLI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ "`echo ${1} | grep -i mongo`" ]; then | |
PASS=$(bw get item "${1}" | jq --join-output --raw-output .login.password | jq --slurp --raw-input '@uri' --raw-output) | |
else | |
PASS=$(bw get item "${1}" | jq --join-output --raw-output .login.password) | |
fi | |
echo ${PASS} | |
echo ${PASS} | pbcopy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment