How to filter items using the 1Password CLI

This discussion was created from comments split from: Filter by attachments.

Comments

  • LieutenantLefse
    LieutenantLefse
    Community Member
    edited September 2023

    I found this thread as I had the same issue, trying to find all items with attachments, across thousands of items. If you're willing to set up the 1Password CLI and have jq available, here's how to find them all:

    op --format json item list | op --format=json item get - | jq 'select(.files != null) | {id, title, filename: .files[].name}'

    I know it's an old thread and this doesn't help on iOS, but since I worked out the jq I might as well post it here for posterity. It wouldn't take much more to pipe that into another op command to add a tag to each item.

This discussion has been closed.