It’s Cybersecurity Awareness Month! Join our interactive training session, or learn about security and AI from 1Password experts.
Forum Discussion
Former Member
4 years agocli v2.6.0: Editing items with `op item get | jq | op item edit` does not create new fields
I'm reading the output of op item get (v2.6.0) and adding a brand new field to an existing section using jq . It looks like this:
op item get "top-secret" |
jq '.fields + [{
i...
andi_t_1P
1Password Team
4 years agoHi @unrob! The main impediment here is that though we support piped input for creating an item, we do not currently support piped input for editing one. This means that the above op item edit "top-secret"
will not see the provided json at all and when it executes it will just edit the item "in place", replacing it with itself and only incrementing the version. May I suggest that you use field assignments (shell arguments) for this task:
Add a new custom field to an item's section:
`op item edit 'My Example Item' 'section2.field5[phone]=1-234-567-8910'`
(extracted from the docs: op item edit --help
)
Is there any reason why the above solution is not desirable in your case?
Best,
Andi