Created
September 18, 2025 09:03
-
-
Save phrawzty/05f9f5825a50c1f050d226cbff8c57fe to your computer and use it in GitHub Desktop.
Quick script to display site and username from jq output, then pipe the password to pbcopy. This is handy since it avoids multiple calls to the bw bin (and thus multiple password prompts).
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 zsh | |
| # This just uses jq to output the site name, username, and password. | |
| # Functional but exposes the password. | |
| #bw list items --search ${1} | jq '.[] | {name: .name, username: .login.username, password: .login.password}' | |
| # This will output the site name and username, but not the password; instead, | |
| # the password is piped directly to pbcopy so it isn't exposed visually. | |
| bw list items --search ${1} | jq -r '.[] | .login.password, "---", "name: \(.name)\nusername: \(.login.username)"' | { read -r pass; read -r sep; cat; echo "$pass" | pbcopy; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment