This program allows you to generate TOTP codes from the command line.
Install the required dependencies:
pip install -r requirements.txt
sudo cp ./totp.py /usr/local/bin/totp
sudo chmod +x /usr/local/bin/totp
Providing the secret as an argument:
totp add -s <service> --secret <secret>
Providing the URL as an argument:
totp add -s <service> --url <url>
If you don't know what these are, you should be able to find them by reading the QR code provided by the service.
You can update a service by replacing the add
command with update
.
totp -s <service>
To automatically copy the code to the clipboard, add the -c
flag.
Is this program secure? I guess so: it stores the secrets using the keyring
module, which uses the system's keyring and uses oathtool
to generate the codes.
Anyway, use it at your own risk.