Skip to main content
December 14, 2021
Question

[33,34] Edit Multiple fields at once

  • December 14, 2021
  • 7 replies
  • 81 views

I have a lot of fields to add/update in an exiting 1Password item, and I was wondering if I could to a "bulk" edit in someways ?

E.g. I am looking forward something like op item edit --template ...

I have not seen such option in the documentation. Is there a way to achieved that ?


1Password Version: 7.9.2
Extension Version: 2.0.0-beta.7
OS Version: macOS 11.6

7 replies

December 14, 2021

Right now, I am creating a (long) command string with all fields to set:


op item edit --vault myVault 'section1.field1[Text]=value1' 'section1.field2[Text]=value2' 'section1.field3[Text]=value3' ....

That's OK but still thinking the template option would give more flexibility :)

December 16, 2021

Hey @ebreton

Templates are currently not supported for op item edit, but we'll keep that in mind.

For the time being, what you are doing - a command with a bunch of field assignments is the only way to do it in the CLI.

Since you are already using assignment statements, would you have any feedback on them?

December 16, 2021

Hi @"Justin.Yoon_1P"

I like the syntax section.attribute[type]=value and I did not find any issues or edge cases so far.

I am sending python objects as strings. The only trick was to get them back as objects (at least for basic types) and the nice solution was to use ast.literal_eval on python side.

December 17, 2021

That's good to hear, thanks for the feedback!

Interesting that you are setting the values to python object strings (if I understand you correctly)!

December 18, 2021

I concur if there was a way to read from stdin or a file for the bulk updating of fields as well, it would be helpful. Being able to generate a json/yaml would be something I'd be interested in

December 19, 2021

Yes, you got it: simple python strings :)

It makes it easy to read (and use) on the 1Password apps, and it is straightforward to send (and parse)

Maybe at some point it will be JSON or something else... but no need for now

1Password Employee
December 31, 2021

Thank you both for your feedback @ebreton and @chrisgoffinet.

I agree both op item edit --template (which would work similarly to op item create --template) and piping a JSON template into op item edit add value and make a lot of sense. We should also add support for piping to op item create in my opinion.

I've tracked a ticket for us internally to add both of these. Thanks again for letting us know this will be useful for you 🙌