Forum Discussion

Former Member's avatar
Former Member
2 years ago

Can I somehow update field data (label in particular) manually via the CLI?

I have some saved password where autofill puts them in the wrong field - the site where I'm using it has a "user login" field and an "admin login" field. They have distinct field names, and if I create a new record it fills the correct field. And indeed, when I look at the JSON data of the newly created record it uses the correct field name in the "label" field:

json
{
"id": "password",
"type": "CONCEALED",
"purpose": "PASSWORD",
"label": "adminPassword",
"value": "XXX",
"reference": "op://Personal/XXX/adminPassword",
"password_details": {}
}

However, I have quite a few such records that use the wrong field (with "label": "password") and I REALLY do not want to recreate all of them.

So I wonder if there's some way to use the CLI to update this label field since neither the web version nor the Desktop app have a way to edit this.

I'd be perfectly fine with manually crafting a JSON patch or editing the JSON, but I couldn't find any way to actually update a record with a custom JSON body...


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Browser: Not Provided

1 Reply

  • Former Member's avatar
    Former Member

    Hi @ThiefMaster, I am sorry for the delay in our response here.

    Updating the label should be possible on the app, for the second password field that you are referring to, because it's a custom field. The default password field label is not configurable though. Could you share a screenshot of what's happening on your app if you continue to see the same issue with the custom fields?

    In terms of CLI though, this should be possible by is a bit tricky: you'll need to delete the field first and then recreate with the necessary label:

    op item edit test 'add more.password[delete]' -- add more is my section name, password is the field name, delete is a function that instructs what should happen to the field.

    op item edit test 'adminPassword=hey -- new field adminPassword with the value hey

    Don't hesitate to reach out if you have any followup questions!