Using the CLI, how can I get an OTP value in a template (tpl)?
If I just refer to an item, like "{{ op://Vault/my_item/one-time password }}", it outputs the 32 char string that generates the value. However, I don't need that string, I need the value that's generated. How do I get it?
1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Referrer: forum-search:cli
Comments
-
Yeah I have the same problem, doesn't seem to be supported, given there's no mention in the documentation about it. I suppose you could just use something like this:
export SOME_VAR=$(op item get <item> --otp)
0 -
Hey all,
Indeed, this is currently not natively supported, and the workaround that @andrepereira proposes is the cleanest way to achieve this, at the moment. However, adding an alternative for fetching different field attributes (other than the value) with secret references is on our short roadmap, so stay tuned for the next releases!
Best,
Horia0