Forum Discussion

flozza's avatar
flozza
New Contributor
10 days ago

Search for CLI

Hi!

I'd like to request a feature: For the 1Password CLI (`op`) to support searching, just like the GUI client does.

My use case: I have about 30 or so entries that I would like to add a tag to. All entries belong to the same domain "home.mydomain.com" (many have subdomains on it). In the GUI client I type "home.mydomain.com" and they all come up.

I want to use a script using the `op` CLI to edit each, adding a tag to them. Right now the only method I can find is to first list all items and then retrieve each and do the search myself. That's very slow. It would be great if I could send a search them off and get back a list of results.

This could be as simple as `op item search "home.mydomain.com" --format=json` and then I could edit each of those items.

Thanks!

2 Replies

  • 1P_SimonH's avatar
    1P_SimonH
    Icon for Community Manager rankCommunity Manager

    jake thanks for sharing a potential workaround!

    flozza I've also added your suggestion as a feature request for consideration. Thanks for so clearly laying out your use case!

    ref: PB-49237143

  • jake's avatar
    jake
    New Contributor

    Although it may not exist in OP - have you considered using the API service? You can throw together a simple api handler in Python.

    GET /v1/vaults/{vault_id}/items?filter=title contains "bank"

    GET /v1/vaults/{vault_id}/items?filter=title eq "Amazon" and category eq "LOGIN"