Created
August 28, 2023 13:36
-
-
Save cherryramatisdev/e4606fec67f16d7d5a1a0e33e4ef3697 to your computer and use it in GitHub Desktop.
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 | |
| passwords=$(bw list items | jq '.[] | {id: .id, name: .name}') | |
| selected_password=$(echo "$passwords" | jq -r '.name' | fzf) | |
| selected_password_id=$(echo "$passwords" | jq "select(.name == \"$selected_password\").id" | tr -d '"') | |
| password=$(bw get item "$selected_password_id") | |
| if [[ "$password" != "" ]]; then | |
| echo "Copied password from $selected_password with $(echo "$password" | jq '.login.username') username to clipbord..." | |
| echo "$password" | jq '.login.password' | tr -d '"' | pbcopy | |
| fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment