MCPcopy Index your code
hub / github.com/dim13/otpauth

github.com/dim13/otpauth @v0.6.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.6.0 ↗ · + Follow
83 symbols 167 edges 14 files 19 documented · 23%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Google Authenticator migration decoder

Logo

Convert Google Authenticator otpauth-migration://offline?data=... transfer links to plain otpauth links.

Usage

  • Navigate to ⋮ → Transfer accounts → Export accounts.
  • Extract migration link from QR-code using your preferred software.
  • Pass link to otpauth tool.

Flags

  -dump
        dump as prototext
  -eval
        evaluate otps
  -http string
        serve http (e.g. localhost:6060)
  -info
        display batch info
  -link string
        migration link (required)
  -qr
        generate QR-codes (optauth://)
  -rev
        reverse QR-code (otpauth-migration://)
  -workdir string
        working directory

Example

go install github.com/dim13/otpauth@latest

Or get latest binary release.

Usage

~/go/bin/otpauth -link "otpauth-migration://offline?data=CjEKCkhlbGxvId6tvu8SGEV4YW1wbGU6YWxpY2VAZ29vZ2xlLmNvbRoHRXhhbXBsZTAC"

Will output:

otpauth://totp/Example:alice@google.com?issuer=Example&secret=JBSWY3DPEHPK3PXP

QR-Codes

~/go/bin/otpauth -qr -link "otpauth-migration://offline?data=CjEKCkhlbGxvId6tvu8SGEV4YW1wbGU6YWxpY2VAZ29vZ2xlLmNvbRoHRXhhbXBsZTAC"
# view and scan *.png in current working directory

Will generate:

Example

Serve http

~/go/bin/otpauth -http=localhost:6060 -link "otpauth-migration://offline?data=CjEKCkhlbGxvId6tvu8SGEV4YW1wbGU6YWxpY2VAZ29vZ2xlLmNvbRoHRXhhbXBsZTAC"

Navigate to http://localhost:6060/

Docker

A Docker container can also be used to run the application by building and running the image as following

Build image

From the current directory run

docker build . -t otpauth:latest

Run container

To start a container from the previously created image run

docker run --name otpauth -p 6060:6060 -v $(pwd)/workdir:/app/workdir --rm otpauth:latest -workdir /app/workdir -http :6060 -link "otpauth-migration://offline?data=CjEKCkhlbGxvId6tvu8SGEV4YW1wbGU6YWxpY2VAZ29vZ2xlLmNvbRoHRXhhbXBsZTAC"
-p 6060:6060
Map the host 6060 to the containr 6060

-v $(pwd)/workdir:/app/workdir
Map the host dir to the containr dir

Navigate to http://localhost:6060/

Other projects

See also https://github.com/dim13/2fa for simple CLI 2FA evaluator

Core symbols most depended-on inside this repo

URL
called by 5
migration/convert.go
Count
called by 4
migration/migration.go
UnmarshalURL
called by 3
migration/unmarshal.go
Evaluate
called by 3
migration/evaluate.go
SecretString
called by 2
migration/convert.go
QR
called by 2
migration/qrcode.go
PNG
called by 2
migration/qrcode.go
Data
called by 2
migration/unmarshal.go

Shape

Method 56
Function 20
Struct 4
TypeAlias 3

Languages

Go100%

Modules by API surface

migration/migration.pb.go50 symbols
migration/unmarshal.go5 symbols
migration/migration.go5 symbols
migration/evaluate.go5 symbols
http.go4 symbols
migration/convert.go3 symbols
migration/qrcode.go2 symbols
migration/convert_test.go2 symbols
migration/cleanname.go2 symbols
main.go2 symbols
migration/handler.go1 symbols
migration/evaluate_test.go1 symbols

For agents

$ claude mcp add otpauth \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page