{"id":36454131,"url":"https://github.com/floj/totpgen","last_synced_at":"2026-01-11T23:01:06.692Z","repository":{"id":144324147,"uuid":"328641443","full_name":"floj/totpgen","owner":"floj","description":"Utility to generate TOTP tokens","archived":false,"fork":false,"pushed_at":"2024-03-12T10:59:46.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-21T16:43:49.759Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/floj.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-11T11:25:43.000Z","updated_at":"2024-04-09T00:08:01.000Z","dependencies_parsed_at":"2024-03-12T11:52:31.052Z","dependency_job_id":"bf324bc2-2a8a-4cd0-8ce6-80595ed05324","html_url":"https://github.com/floj/totpgen","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/floj/totpgen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floj%2Ftotpgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floj%2Ftotpgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floj%2Ftotpgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floj%2Ftotpgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/floj","download_url":"https://codeload.github.com/floj/totpgen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floj%2Ftotpgen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28326166,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T22:11:01.104Z","status":"ssl_error","status_checked_at":"2026-01-11T22:10:58.990Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-01-11T23:01:05.979Z","updated_at":"2026-01-11T23:01:06.682Z","avatar_url":"https://github.com/floj.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# totpgen\nUtility to generate TOTP tokens\n\n## Usage\n\nThe secret tokens are saved in the systems keychain (via [99designs/go-keychain](https://github.com/99designs/go-keychain)).\n\nTo add a totp TOTP secret, run\n```sh\ntotpgen set \"\u003csecret-name\u003e\" \"totp-secret\"\n# eg\ntotpgen set google \"SAucYHYJyfma1Fa6uFlBqzUluusgIj1slSwKRoVvhGYZsVCt\"\ntotpgen set aws \"44uHJtA8IwpKy9JjaaprSizgZ2TSImDY8iUPvm1qaDHReOTJ\"\n```\n\nTo generate the current OPT code run\n```sh\ntotpgen google\n# output:\n123456\n```\n\nYou can also create a symlink to the script and name it after `totpgen-\u003cname\u003e` (e.g. `totpgen-google`).\nInvoking the tool like this will also print the TOTP token for the specified name, no arguments required.\n\n```sh\nln -sT totpgen totp-google\ntotp-google\n# output:\n123456\n```\n\nThere are a couple more commands:\n```sh\n# show the names of saved totp configuration\ntotpgen list\n# output:\ngoogle\naws\n\n# to remove a secret use the 'set' command with an empty secret\ntotpgen set google \"\"\n\n# rename a secret\ntotpgen rename google google-dev\n\n# show available keychain backends\ntotpgen backends\n# output\nsecret-service\nkwallet\nkeyctl\npass\nfile\n```\n\n## Installation\nVia `go install`:\n```sh\ngo install github.com/floj/totpgen\n~/go/bin/totpgen --help\n```\n\nManual\n```sh\ngit clone https://github.com/floj/totpgen.git\ncd totpgen\n./build.sh\n./totpgen --help\n```\n\n### MacOS\nI don't provide precompiled binaries, because past expirence showed that cross-compiled binaries for Mac do not properly work with the OSX keychain. Thus, if you want to use it on Mac, you need to compile it yourself using one of the above command.\n\n#### Additionally available config options for MacOS\n\n| Environment variable  | Configuration | Example |\n|-----------------------|---------------|---------|\n| `TOTPGEN_KEYCHAIN_NAME` | Name of the Keychain files used | `TOTPGEN_KEYCHAIN_NAME=totpgen-secrets` |\n\n\n## Why?\nMain motivation was to use it in [aws-vault](https://github.com/99designs/aws-vault). AWS Vault supports creating TOTP tokens via [pass-otp](https://github.com/tadfisher/pass-otp). This is very nice, but limits you to use `pass`. I created a `scriptmfa` prompt provider (see [genericscript.go](https://github.com/floj/aws-vault/blob/master/prompt/genericscript.go)) that is able to call whatever script you want. Just point it to `totpgen-aws` by setting `AWS_VAULT_MFA_SCRIPT=totpgen-aws` and you are good to go.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloj%2Ftotpgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffloj%2Ftotpgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloj%2Ftotpgen/lists"}