[SOLVED] How to escape characters

sososo
sososo
Community Member
edited May 2023 in CLI

Hi all,
I am trying to retrieve a password from 1Password but I am unable to retrieve the password if the item conteins characters such as "" or ":"

$ op read 'op://myvault/DEV: foo/mysection/password'

[ERROR] 2023/05/17 13:32:21 could not read secret op://myvault/DEV: foo/mysection/password: invalid secret reference 'op://myvault/DEV: foo/mysection/password': invalid character in secret reference: ':'

$ op read 'op://myvault/DEV: foo/mysection/password'

[ERROR] 2023/05/17 13:32:28 could not read secret op://myvault/DEV\: foo/mysection/password: invalid secret reference 'op://myvault/DEV\: foo/mysection/password': invalid character in secret reference: '\'

Using the following works fine
op item get "DEV: foo" --vault "myvault" --format json

Am I missing something obvious? Thanks for your help.


1Password Version: 8.10.6
Extension Version: 2.17.0
OS Version: 13.3.1a
Browser:_ Firefox

Comments

  • sososo
    sososo
    Community Member

    Simple, use the ID ;)

    You can specify each part of a secret reference using its name or ID

  • Glad you got this sorted out! Do let us know if we can help with anything else.

    Best,
    Horia

This discussion has been closed.