Signing back into the Community for the first time? You'll need to reset your password to access your account. Find out more.
Forum Discussion
misterJJ
3 years agoNew Contributor
List items from set of vaults
Hi,
I feel like I must be overlooking something as this seems quite simple.
I'm using the command op vault list --group groupname --format=json | op vault get -
The command retrieves a list o...
Nhat_Nguyen
1Password Team
3 years agoHello misterJJ,
To get a list of items from your vaults, we can give these steps a try.
We will leverage jq to help us retrieve vault IDs from JSON. jq is a command line tool used to process JSON. Please have a look here to learn more and to install
After that, we can then create a list of vaults a group has access to, then use jq to extract the vault ids and put them in a file.
op vault list --group <group name> --format json |\
op vault get - --format json |\
jq '.id' | sed 's/"//g' > list.txt
Finally, you can get items list from vault IDs in the file and remove the file.
cat list.txt | while read line; do
op item list --vault $line
done
rm list.txt
Best regards,
Nhat Nguyen.
https://support.1password.com/