Skip to main content
May 17, 2023
Question

[SOLVED] How to escape characters

  • May 17, 2023
  • 2 replies
  • 315 views

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

2 replies

sososoAuthor
May 17, 2023

Simple, use the ID ;)

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

May 26, 2023

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

Best,
Horia