2fa-cmd
v0.0.6
Published
A command tool for Google Authenticator
Downloads
26
Maintainers
Readme
2fa-cmd
Google Authenticator or other OTP application in command.
Install
npm i 2fa-cmd -g
Contribute
$ git clone [email protected]:x-ray-s/2fa-cmd.git
$ cd 2fa-cmd
$ npm i && npm run build && npm link
CLI
$ 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
TODO
- [x] npm publish
- [x] rename
- [ ] password
- [ ] encrypto
- [ ] custom storage path
HOW
How to import Google Authenticator in command?
- 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