Forum Discussion

Former Member's avatar
Former Member
5 years ago

[33,34] Edit Multiple fields at once

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

  • 1P_Simon's avatar
    1P_Simon
    Icon for 1Password Team rank1Password Team

    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 🙌

  • Former Member's avatar
    Former Member

    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

  • Former Member's avatar
    Former Member

    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

  • Former Member's avatar
    Former Member

    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)!

  • Former Member's avatar
    Former Member

    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.

  • Former Member's avatar
    Former Member

    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?

  • Former Member's avatar
    Former Member

    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 :)