This CLI helps to manage your one time passwords for different accounts/environments. The goal of this tool is to help you generate one time passwords quickly from the command line that you can pipe into your clipboard. This saves you from having to pull out your phone and cracking open the Google Authenticator app to generate a one time password.
In order to use this software you will need access to the secret embedded in the provisioning uri used to set up your two factor authentication account. This usually comes in the form of a QR Code and might look like:
'otpauth://totp/alice@google.com?secret=JBSWY3DPEHPK3PXP'
$ gem install tfa
To add a secret you can use the add command. The key you use can be anything you choose. In the example below the key is development.
$ tfa add development <secret>
To display the secret associated with a key:
$ tfa show development
To generate a time based one time password for a specific key.
$ tfa totp development
$ 260182
You can also pipe it to your clipboard.
$ tfa totp development | pbcopy
or
$ tfa totp development | xclip -selection clipboard
- Fork it ( https://github.com/mokhan/tfa/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request