Skip to main content

Edit items

To edit an existing item in your 1Password account, use the op item edit command.

You can edit basic information about the item with flags and use assignment statements to edit an item's built-in and custom fields. To edit sensitive values, use a JSON template.

You can't use op item edit to edit SSH keys. Learn more about managing SSH keys with 1Password CLI.

Requirements

Before you can use 1Password CLI to edit items, you'll need to:

Follow along

If you want to follow along with the examples in this guide, create the example items in the guide to creating items first.

Edit an item's basic information

To edit an item, use op item edit and specify the item by name, unique identifier (ID), or sharing link.

You can use flags to generate a new password and edit an item's title, vault, or tags. You can also change the website where 1Password suggests and fills a Login, Password, or API Credential item.

For example, to change the name of the example item Netflix, move it from the Tutorial vault to the Private vault, update its tags, edit its website, and generate a new random password:

To change the example item name back to Netflix and move it back to the Tutorial vault:

Edit built-in and custom fields

danger

Command arguments can be visible to other processes on your machine. To edit sensitive values, use an item JSON template instead.

The op item edit command can take a list of assignment statements as arguments to edit an item's built-in and custom fields.

  • section (Optional) The name of the section where the field is saved.
  • field The name of the field.
  • fieldType The type of field. If unspecified, the fieldType stays the same.
  • value The information you want to save in the field. If unspecified, the value stays the same.

For example, to change the subscription renewal date on the HBO Max item:

Delete a custom field

To delete a custom field, specify [delete] in place of the fieldType. If you remove all the fields in a section, the section is also removed. You can't delete empty fields, but you can set them to empty strings.

To use an assignment statement to delete the subscription renewal date on the example HBO Max item:

Edit an item using a JSON template

To edit sensitive values on an item, use an item JSON template.

  1. Get the JSON output for the item you want to edit and save it to a file.

    If you prefer to start over, you can get a blank template for the item's category with op item template get.
  2. Edit the file.

  3. Use the --template flag to specify the path to the edited file and apply the changes to the item:

  4. Delete the file.

You can also edit an item using piped input:

To avoid collisions, you can't combine piped input and the --template flag in the same command.

Next steps

If you created a Tutorial vault, you can delete the vault and the examples items you created:

Learn more

Was this page helpful?