Can `op edit` add or change values in an array?
I'd like to script the addition of websites to the URLs
list of some login items. (I'm coming from LastPass, where I had a lot of equivalent domains defined.) So I have an item like this (abridged):
$ op get item kd7bhqzz7vojq3emrkejmqrr7m | jq { "uuid": "kd7bhqzz7vojq3emrkejmqrr7m", ... "overview": { "URLs": [ { "l": "website", "u": "https://example.com" }, { "l": "website 2", "u": "https://foobar.com" } ], ... "url": "https://example.com" } }
And I've tried things like:
$ op edit item kd7bhqzz7vojq3emrkejmqrr7m URLs.1.u='blahblah' $ op edit item kd7bhqzz7vojq3emrkejmqrr7m overview.URLs[1].u='blahblah' $ op edit item kd7bhqzz7vojq3emrkejmqrr7m overview.URLs[2]='{"l": website 3", "u": "blahblah"}' $ op edit item kd7bhqzz7vojq3emrkejmqrr7m overview.URLs.2='{"l": website 3", "u": "blahblah"}'
but they always just give [ERROR] ... The item doesn't have a "URLs.1.u" field.
(or similar).
I don't see any documentation of assignment statement syntax that would accomplish this. Am I missing something, or is this not supported (yet)?
1Password Version: 1.8.0
Extension Version: Not Provided
OS Version: Not Provided
Sync Type: Not Provided
Referrer: forum-search:op edit item
Comments
-
Hey @P1h3r1e3d13 ,
Looks like what you are trying to do is not supported yet. The only thing that is possible is editing the first URL of an item using
op edit item [UUID] url=www.website.com
Editing existing items is a bit limited at the moment and we hope to improve and enhance it in the future :)
0 -
-
The reference guide you linked to is the best source of information on the CLI at the moment.
I'll forward your request for better documentation. Thank you for bringing that up! :+1:
0