Using "op" CLI to get MFA Code Value

HiThere
HiThere
Community Member

Hi, is there away to get the current MFA value from "op" command line tool?

For example I want to get a value by running the following
op get item My_AWS_Creds | jq '.details.fields[] | select(.name=="mfacode").value'

This will be very useful especially now that the AWS CLI supports MFA session tokens.


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

Comments

  • HiThere
    HiThere
    Community Member

    Actually nevermind, I digged deep in the "get" subcommands and found the answer, I had to run
    $ op get totp My_AWS_Creds
    495357

  • ag_ana
    ag_ana
    1Password Alumni

    Thank you for the update @HiThere! It's great to hear that you managed to find this already.

    If you have any other questions, please feel free to reach out anytime.

    Have a wonderful day :)

This discussion has been closed.