when i run the command op list items --vault=Myvaut i get all the data except "Other Fields" values

ramimohsen
ramimohsen
Community Member

when i run the command op list items --vault=Myvaut i get all the data except "Other Fields" values

This is a sample record
{
"uuid": "****************",
"templateUuid": "001",
"trashed": "N",
"createdAt": "2019-02-28T17:38:06Z",
"updatedAt": "2019-06-13T12:43:07Z",
"changerUuid": "*************************",
"itemVersion": 6,
"vaultUuid": "*******************",
"overview": {
"URLs": [
{
"l": "website",
"u": "https://w3.ibm.com/homepage"
}
],
"ainfo": "********************************",
"pbe": 131.2614924386442,
"pgrng": true,
"ps": 100,
"tags": [],
"title": "ACCLAIM APPLICATION-ID",
"url": "https://w3.ibm.com/homepage"
}
},

Kindly see the attachment file .

0.8.0 (build #80002) – released 2019-11-07

Thanks


1Password Version: 0.8.0
Extension Version: Not Provided
OS Version: Not Provided
Sync Type: Not Provided
Referrer: forum-search:command line

Comments

  • felix_1p
    felix_1p
    1Password Alumni

    op list items is meant to only give you an overview of the items. It actually already prints out more information than we want. If you want to get all the details of an item, you can extract the UUID of the item you want and use op get item <uuid> --vault=<vault> instead.

    Do you have a specific reason for wanting the additional fields in the op list items output?

  • ramimohsen
    ramimohsen
    Community Member
    edited January 2020

    thanks a lot for your reply .

    yes i do have , your solution does make since but i have more than 300 records in the vault so it will be very in-practical to apply the command you specified on each record i need a way to retrieve all info one shoot

  • felix_1p
    felix_1p
    1Password Alumni
    edited January 2020

    I see. You can use jq to extract the UUID (and vault UUID) from each item and call op get item automatically:

    Example with for loop:

    for data in $(op list items | jq -r '.[] | .uuid + "|" + .vaultUuid'); do
        item_uuid=$(echo "$data" | cut -d '|' -f 1)
        op get item $item_uuid --vault=$(echo "$data" | cut -d '|' -f 2) > "${item_uuid}.json"
    done
    

    Example with while loop

    op list items | jq -r '.[] | .uuid + " " + .vaultUuid' | while read item_uuid vault_uuid; do 
      op get item $item_uuid --vault=$vault_uuid < /dev/null > "${item_uuid}.json"
    done
    

    It's a bit more cumbersome atm than we would like to, but it works.

  • ramimohsen
    ramimohsen
    Community Member

    Thanks a lot it worked
    only the first solution using the for loop has some issues in syntax but the other worked fine with some modification of what i need exactly
    Thanks again :)

  • felix_1p
    felix_1p
    1Password Alumni

    You're are very welcome :) Totally possible that I made some mistakes, I edited some things after I copied it into the forum...

This discussion has been closed.