Skip to content

Instantly share code, notes, and snippets.

@dwallraff
Last active September 28, 2018 11:12
Show Gist options
  • Save dwallraff/08687081f8fcff62ab30ee9e8072a3b8 to your computer and use it in GitHub Desktop.
Save dwallraff/08687081f8fcff62ab30ee9e8072a3b8 to your computer and use it in GitHub Desktop.
Export all item metadata from 1Password
#! /usr/bin/env bash
## Copy all item metadata from 1password
# Get all item UUIDs
# shellcheck disable=2016
op list items | jq -r '.[].uuid' > items_list
# Loop over list and save off all the metadata
TODAY=$(date "+%Y%m%d")
COUNTER=0
TOTAL=$(wc -l < items_list)
while read -r i; do
(( COUNTER++ ))
echo "Getting item #$COUNTER of $TOTAL..."
op get item "$i" >> "$TODAY"_1password_backup.json; echo >> "$TODAY"_1password_backup.json
done < items_list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment