> ## Documentation Index
> Fetch the complete documentation index at: https://www.1password.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Edit items

export const Small = ({children}) => {
  return <small>{children}</small>;
};

To edit an existing item in your 1Password account, use the [`op item edit`](/cli/reference/management-commands/item#item-edit) command.

You can [edit basic information about the item](#edit-an-item’s-basic-information) with flags and use assignment statements to [edit an item's built-in and custom fields](#edit-built-in-and-custom-fields). To edit sensitive values, [use a JSON template](#edit-an-item-using-a-json-template).

<Small>You can't use <code>op item edit</code> to edit SSH keys. Learn more about <a href="/cli/ssh-keys">managing SSH keys</a> with 1Password CLI.</Small>

## Requirements

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

* [Sign up for 1Password](https://1password.com/pricing/password-manager)
* [Install 1Password CLI](/cli/get-started#step-1-install-1password-cli)

<Note>
  **Follow along**

  If you want to follow along with the examples in this guide, [create the example items in the guide to creating items](/cli/item-create) first.
</Note>

## Edit an item's basic information

To edit an item, use [`op item edit`](/cli/reference/management-commands/item#item-edit) and specify the item by name, [unique identifier (ID)](/cli/reference#unique-identifiers-ids), 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:

<Tabs groupId="shells">
  <Tab title="Bash, Zsh, sh, fish">
    ```shell theme={null}
    op item edit "Netflix" \
        --title "Edited Netflix" \
        --vault Private \
        --tags tutorial \
        --url https://www.netflix.com \
        --generate-password='letters,digits,symbols,32'

    ```
  </Tab>

  <Tab title="PowerShell">
    ```powershell theme={null}
    op item edit "Netflix" `
        --title "Edited Netflix" `
        --vault Private `
        --tags tutorial `
        --url https://www.netflix.com `
        --generate-password='letters,digits,symbols,32'
    ```
  </Tab>
</Tabs>

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

<Tabs groupId="shells">
  <Tab title="Bash, Zsh, sh, fish">
    ```shell theme={null}
    op item edit "Edited Netflix" \
        --title "Netflix" \
        --vault Tutorial
    ```
  </Tab>

  <Tab title="PowerShell">
    ```powershell theme={null}
    op item edit "Edited Netflix" `
        --title "Netflix" `
        --vault Tutorial
    ```
  </Tab>
</Tabs>

## 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](#edit-an-item-using-a-json-template) instead.
</Danger>

The `op item edit` command can take a list of assignment statements as arguments to edit an item's [built-in and custom fields](/cli/item-fields).

```shell theme={null}
[<section>.]<field>[[<fieldType>]]=<value>
```

* `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:

<Tabs groupId="shells">
  <Tab title="Bash, Zsh, sh, fish">
    ```shell theme={null}
    op item edit "HBO Max" \
        'Renewal Date=2023-5-15'
    ```
  </Tab>

  <Tab title="PowerShell">
    ```powershell theme={null}
    op item edit "HBO Max" `
        'Renewal Date=2023-5-15'
    ```
  </Tab>
</Tabs>

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

<Tabs groupId="shells">
  <Tab title="Bash, Zsh, sh, fish">
    ```shell theme={null}
    op item edit "HBO Max" \
        'Renewal Date[delete]=2023-5-15'
    ```
  </Tab>

  <Tab title="PowerShell">
    ```powershell theme={null}
    op item edit "HBO Max" `
        'Renewal Date[delete]=2023-5-15'
    ```
  </Tab>
</Tabs>

## Edit an item using a JSON template

<Danger>
  JSON item templates do not support passkeys. If you use a JSON template to update an item that contains a passkey, the passkey will be overwritten. To fix this, you can [restore a previous version of the item](https://support.1password.com/item-history/).
</Danger>

To edit sensitive values on an item, use an [item JSON template](/cli/item-template-json).

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

   ```shell theme={null}
   op item get <item> --format json > newItem.json
   ```

   <Small>If you prefer to start over, you can get a blank template for the item's category with <a href="/cli/reference/management-commands/item#item-template-get"><code>op item template get</code></a>.</Small>

2. Edit the file.

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

   ```shell theme={null}
   op item edit <item> --template=newItem.json
   ```

4. Delete the file.

You can also edit an item using piped input:

```shell theme={null}
	cat newItem.json | op item edit <item>
```

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:

```shell theme={null}
op vault delete "Tutorial"
```

## Learn more

* [`op item` reference documentation](/cli/reference/management-commands/item)
* [Built-in and custom item fields](/cli/item-fields)
* [Item JSON template](/cli/item-template-json)
* [Workflow: Build integrations with 1Password](/get-started/build-integrations)
