2fa-cmd

0.0.6 • Public • Published

2fa-cmd

Google Authenticator or other OTP application in command.

screenshot

Install

npm i 2fa-cmd -g

Contribute

$ git clone git@github.com: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?

  1. Open the Authenticator, Click Menu on left top;
  2. Transform account and export accounts;
  3. You will get a qrcode image;
  4. Decode the qrcode. eg. https://cli.im/deqr
  5. You will get a schema URL like otpauth-migration://offline?data=
  6. 2fa import --url '<your url>' > notice the quotation mark

Package Sidebar

Install

npm i 2fa-cmd

Weekly Downloads

6

Version

0.0.6

License

MIT

Unpacked Size

16.7 kB

Total Files

17

Last publish

Collaborators

  • princess_war