A command-line utility for working with TOTP (Time-based One-Time Password) codes
- Generate current OTP codes from a secret
- Validate OTP codes against a secret
- Generate secure random OTP secrets
Install the package using pip:
pip install otp-cli-utils
Get the current OTP code for a given secret:
otp-cli-utils get-otp {{secret}}
Example:
otp-cli-utils get-otp ABCDEF1234567890
Validate if an OTP code matches the expected value for a given secret
otp-cli-utils validate {{otp}} {{secret}}
Example:
otp-cli-utils validate 123456 ABCDEF1234567890
Generate a new secure random secret key for OTP generation
otp-cli-utils generate-secret
-
0
: Command executed successfully -
1
: Invalid OTP (for validate command) or error occurred
This project is licensed under the MIT License - see the LICENSE file for details.