Skip to main content
June 9, 2025
Question

Search for CLI

  • June 9, 2025
  • 3 replies
  • 210 views

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!

3 replies

June 9, 2025

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"

1P_SimonH
Community Manager
June 9, 2025

@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

January 29, 2026

Too late for the op but maybe this is useful for someone else

If you have fzf installed, this one liner will search and then print the content

op item get (op item list | fzf --header-lines=1 | awk '{print $1}')

 

thecatfix
February 4, 2026
op item get $(op item list | fzf --header-lines=1 | awk '{print $1}')

This is AWESOME 

thecatfix
February 4, 2026
op item get $(op item list --format json | jq -r '.[] | "\(.id) \(.title) [\(.vault.name)]"' | fzf | awk '{print $1}')

For a cleaner selection interface that includes the Vault name and avoids parsing whitespace columns, use jq to format the entry before passing it to fzf.