Last active
December 9, 2019 08:16
-
-
Save mewwts/35b6a9e3053f8882600d835a64b57684 to your computer and use it in GitHub Desktop.
This is my basic import from 1password to pass.
This file contains 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
#!/bin/bash | |
for uuid in $(op list items | jq '.[] | .uuid' -c -r); do | |
item=$(op get item "$uuid") | |
username=$(echo "$item" | jq '.details.fields | .[] | select(.designation=="username") .value' -r) | |
pass=$(echo "$item" | jq '.details.fields | .[] | select(.designation=="password") .value' -r) | |
url=$(echo "$item" | jq '.overview.url' -r) | |
title=$(echo "$item" | jq '.overview.title' -r | sed s"/ /-/g") | |
title=$(echo ${title,,}) | |
entry=$pass | |
entry+=$'\n\n'"username: $username" | |
entry+=$'\n'"url: $url" | |
echo "$title" | |
echo "$entry" | pass insert 1password/$title -m | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment