Hello everyone π
I recently built a new Python CLI tool called OTP CLI Utils β a lightweight command-line utility to generate, validate, and manage Time-based One-Time Password (TOTP) codes. If you use Google Authenticator or work with 2FA systems, this tool can make your developer workflow a lot smoother.
π GitHub: https://github.com/dilanka-rathnasiri/otp-cli-utils
π PyPI: https://pypi.org/project/otp-cli-utils
π What It Does
OTP CLI Utils provides a simple interface to handle everything related to TOTP (used in 2FA systems). You can:
- π Generate current OTP codes from a secret
- β Validate OTP codes against a secret
- π Generate secure random OTP secrets
- π± Create Google Authenticator compatible QR codes
- π§° All from your command line, no web tools or GUIs needed
βοΈ Installation
You can install it easily from PyPI:
pip install otp-cli-utils
π‘ Usage Examples
πΉ Generate the Current OTP Code
otp-cli-utils get-otp <secret>
Example:
otp-cli-utils get-otp ABCDEF1234567890
πΉ Validate an OTP
Check if an OTP code is valid for a given secret.
otp-cli-utils validate <secret> <otp> [--window-count <count> | --time-period <seconds>]
Examples:
otp-cli-utils validate ABCDEF1234567890 123456
otp-cli-utils validate ABCDEF1234567890 123456 --window-count 2
otp-cli-utils validate ABCDEF1234567890 123456 --time-period 120
πΉ Generate a New OTP Secret
otp-cli-utils generate-secret
πΉ Create a QR Code for Google Authenticator
Easily generate a QR code image to scan directly with authenticator apps.
otp-cli-utils generate-secret-qr-code "user@example.com" "GitHub" github_2fa
π€ Contribute
Contributions, ideas, and feedback are welcome!
Check out the project on GitHub and feel free to open an issue or PR.
π§Ύ License
Released under the MIT License β completely open source.
Top comments (0)