Overwrite a document via the CLI?

Via the CLI, there any way to overwrite a previously created document with an updated version of that document?

I know I could delete the document and then re-create it, but then, the original document ends up in the Trash folder, and if I reference the document after that via the CLI, I have to use its UUID and not its name, since both the original and the new document are shown as existing. This adds a lot of complexity to what, in my opinion, should be nothing more than a simple overwrite operation.

If I could empty the Trash via the CLI, I could then do the following:

(1) delete the original document via the CLI
(2) re-create the updated document by name via the CLI
(3) empty the Trash via the CLI

But step (3) seems to be impossible (see my other recent message here about this topic).

Any ideas of how I could overwrite a document via the CLI without this level of complexity?

Thank you.

1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Sync Type: Not Provided


  • rickfillionrickfillion Junior Member

    Team Member

    Hi @HippoMan,

    It’d be great if this was possible, but currently there’s no way to do it due to the fact that you can’t edit an existing item. We aren’t happy with how item management works in the CLI and we want to rethink it.


  • Yes, replacing an existing item via the CLI would indeed be a useful and helpful feature.

  • brentybrenty

    Team Member

    Thanks for letting us know! :)

  • Just adding another voice in support of updating/replacing items and documents. I've got things working well enough with a delete-old/create-new workflow, but I'd much rather not be filling up the trash.

  • rickfillionrickfillion Junior Member

    Team Member

    Naturally. It's most definitely something we want to make possible.


  • Hey @rickfillion, is there any update on this? Additionally, is there any way to receive document's original file name in CLI client? I'm currently working on a script to backup/sync 1password and it looks like CLI 1password client is very limited.

  • rickfillionrickfillion Junior Member

    Team Member

    Hey @arathunku,

    I have no update to share with respect to updating a document via the CLI. We've been having a lot of discussions internally about item manipulation lately.

    Regarding getting the original filename, it should be available to you via op get item, under details.documentAttributes.

    I hope that helps.


  • I was looking into 1Password CLI so that we can script a sharing/updating of a team-shared secret, and discovered it's not possible to update a document. Ouch!

    Really looking forward to seeing this capability in the CLI, especially given that in the web UI I can upload a new file to replace an existing document...

  • BenBen AWS Team

    Team Member

    Thanks for the feedback on this @Kohsuke. :)


  • felix_1pfelix_1p

    Team Member

    Since v1.7.0 one can use the op edit document command the replace the existing file with new one. https://app-updates.agilebits.com/product_history/CLI#v1070001

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file