Created
December 16, 2018 17:32
-
-
Save simonseyer/4476d8055064e125d61449ec55109bef to your computer and use it in GitHub Desktop.
Download all documents from a 1Password vault (macOS)
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
#!/bin/bash | |
# Dependencies: | |
# 1Password cli tool: https://support.1password.com/command-line/ | |
# jq | |
# | |
# Usage: | |
# ./op_download_documents.sh <op_subdomain> <vault_uuid> | |
# | |
# op_subdomain: 1Password subdomain (login once via `op signin <signinaddress> <emailaddress> <secretkey>`) | |
# vault_uuid The UUID of the vault (see `op list vaults` for the correct UUID) | |
eval $(op signin $1) | |
op list documents --vault=$2\ | |
| jq '.[] | .uuid,.overview.title'\ | |
| xargs -L2 bash -c '[ ! -e "$1" ] && echo "Downloading: $1" && op get document "$0" > "$1"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment