A secure, cross-platform command-line tool to generate Time-based One-Time Passwords (TOTP). It allows you to migrate your 2FA accounts directly from Google Authenticator to your desktop (Linux, Windows, & macOS).
- Direct Import: Reads the
otpauth-migration://QR codes generated by Google Authenticator. - Split Export Support: Automatically stitches together multiple QR codes if you have many accounts.
- Secure Storage: Encrypts your secrets using AES-256-GCM with a key derived via Scrypt.
- Cross-Platform: Runs natively on Linux, Windows, and macOS (Intel & Apple Silicon).
- Zero Dependencies: Statically linked binary, no external runtime required.
| OS | Architecture | Download Link |
|---|---|---|
| Windows | 64-bit | Download .exe |
| Linux | 64-bit | Download Binary |
| macOS | Apple Silicon (M1/M2) | Download Binary |
| macOS | Intel | Download Binary |
Note for Linux/macOS users: After downloading, make the file executable:
chmod +x otpcli-*
mv otpcli-* otpcliRequirements: Go 1.21+
git clone https://github.com/realChriss/otpcli.git
cd otpcli
go mod download
go build -o otpcli main.go- Open Google Authenticator on your phone.
- Tap the menu -> Transfer accounts -> Export accounts.
- Select the accounts you want to transfer.
- Important: If you have many accounts, Google splits them into multiple QR codes.
- Swipe Left on your phone to see subsequent codes.
- Take screenshots of ALL QR codes shown.
- Transfer these images to your computer.
Run the setup command passing all the screenshot files as arguments.
Windows:
.\otpcli.exe setup part1.jpg part2.jpgLinux / Mac:
./otpcli setup part1.png part2.pngThe tool will stitch the data together, prompt for a Master Password, and save the encrypted data to ~/.otpcli.dat.
Simply run the tool without arguments:
./otpcliOutput:
CODE TTL NAME
123456 28s user@example.com (Google)
987654 28s user (GitHub)
MIT