Authenticator

raw JSON →
1.1.3 verified Fri May 01 auth: no python

A HOTP/TOTP code generator for the command line, useful for generating two-factor authentication codes from the terminal. Current version: 1.1.3 (as of verification date). Release cadence: irregular.

pip install authenticator
error ModuleNotFoundError: No module named 'authenticator'
cause Trying to import authenticator in Python code instead of running it as a command.
fix
Run authenticator from the terminal, not from Python's import statement.
error authenticator: error: argument command: invalid choice: 'add' (choose from 'add', 'code', 'list', 'delete', 'rename')
cause Typo or incorrect command name.
fix
Use correct command: authenticator add, authenticator code, authenticator list, authenticator delete, authenticator rename.
gotcha This library is a CLI tool, not a Python module. Do not attempt to import authenticator in Python code; it will raise ModuleNotFoundError.
fix Use the command-line tool directly. If you need programmatic TOTP generation, use a library like pyotp.

Add an account with a base32 secret and generate a TOTP code.

# The primary use is command-line. Example:
# authenticator add myaccount --key 'BASE32SECRET'
# authenticator code myaccount