Google Authenticator or other OTP application in command.
npm i 2fa-cmd -g
$ git clone git@github.com:x-ray-s/2fa-cmd.git
$ cd 2fa-cmd
$ npm i && npm run build && npm link
$ 2fa --help
Usage
$ 2fa <input>
Input
add - Add a new secret
remove - Remove a secret
verify - verify a token
import - Import a secret from url
rename - Rename
get - get one otp
Options
--name <The name of the secret>
--secret <Your secret>
--token <Your token>
--url <The URL parsed by QR code exported from Google Authenticator>
Examples
$ 2fa
$ 2fa add --name <name> --secret FCRJQZSGFD3VMZDE
$ 2fa remove --name <name>
$ 2fa verify --name <name> --token 643223
$ 2fa import --url 'otpauth://totp/...'
$ 2fa rename <old> --name <new>
$ 2fa get --name <name>
$ 2fa --name <name> // same as get
- [x] npm publish
- [x] rename
- [ ] password
- [ ] encrypto
- [ ] custom storage path
- Open the Authenticator, Click Menu on left top;
- Transform account and export accounts;
- You will get a qrcode image;
- Decode the qrcode. eg. https://cli.im/deqr
- You will get a schema URL like otpauth-migration://offline?data=
-
2fa import --url '<your url>'
> notice the quotation mark