{"id":19063980,"url":"https://github.com/jasnell/tfa","last_synced_at":"2025-06-24T00:38:37.383Z","repository":{"id":36773961,"uuid":"41080678","full_name":"jasnell/tfa","owner":"jasnell","description":null,"archived":false,"fork":false,"pushed_at":"2019-05-11T18:05:12.000Z","size":11,"stargazers_count":31,"open_issues_count":2,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-27T06:52:47.629Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jasnell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-20T06:59:44.000Z","updated_at":"2025-02-19T09:22:21.000Z","dependencies_parsed_at":"2022-09-09T07:30:10.438Z","dependency_job_id":null,"html_url":"https://github.com/jasnell/tfa","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasnell%2Ftfa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasnell%2Ftfa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasnell%2Ftfa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasnell%2Ftfa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jasnell","download_url":"https://codeload.github.com/jasnell/tfa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251099735,"owners_count":21536153,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T00:40:53.693Z","updated_at":"2025-04-27T06:52:53.423Z","avatar_url":"https://github.com/jasnell.png","language":"JavaScript","readme":"## A Two-Factor Auth Client\n\nTired of having to pull out your phone all the time to grab those 2fa codes?\n\nInstall: `npm install -g tfa`\n\n### Getting Help\n\n```\nbash-3.2$ tfa\n\n  Usage: tfa [options] [command]\n\n\n  Commands:\n\n    enroll-qrcode|enq [options] \u003cqrcode\u003e  enroll using a qrcode file\n    enroll|en [options]                   enroll\n    generate|gen [options] [label]        generate\n    list|l                                list\n    delete|d \u003clabel\u003e                      delete\n\n  Options:\n\n    -h, --help     output usage information\n    -V, --version  output the version number\n```\n\n### Enroll\n\nMost two factor auth services provide a QRCode for enrollment with applications\nsuch as Google Authenticator on Android. When you're setting up 2fa, save the\nQRCode locally. Then do:\n\n `tfa enq qrcode.png`\n\nWhere `qrcode.png` is the absolute or relative path to your saved QRCode file.\n\n`tfa` will extract both the secret and a label from the QRCode. The label is\nused to generate 2fa codes. Many times, however, the label included in the\nQRCode is not very user friendly. You can set your own local label using the\n`-l` option:\n\n `tfa enq -l foo qrcode.png`\n\nIf the qrcode enrollment isn't working for whatever reason, and you happen to\nknow the TOTP secret being used, you can enroll manually:\n\n `tfa enroll -s {thesecret} -l {label}`\n\n### Listing and Generating\n\nTo see a listing of enrolled services, do:\n\n `tfa list`\n\nThis will print the list of labels out to the console.\n\nTo generate the current TOTP token for a label:\n\n `tfa gen {label}`  (e.g. `tfa gen foo`)\n\nTo generate the current TOTP tokens for all labels:\n\n `tfa gen`\n\n### Cleaning up\n\nTo delete a secret:\n\n `tfa delete {label}` (e.g. `tfa delete foo`)\n\n## Important note about dependencies\n\nThe QRCode scanning function depends on the canvas and jsqrcode modules from\nnpm. To use tfa with QRCodes, there are a few unfortunate prerequisite\ninstallation steps you will need as documented here:\n\n  https://github.com/Automattic/node-canvas/wiki/_pages\n\nIt's not fun, but once you're through it, it should just work.\n","funding_links":[],"categories":["Packages","包"],"sub_categories":["Command-line apps","命令行应用"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasnell%2Ftfa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjasnell%2Ftfa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasnell%2Ftfa/lists"}