Command line TOTP/HOTP authenticator with encrypted database and interactive dashboard
cotp is a command-line two-factor authentication code generator that supports both TOTP (Time-based One-Time Password) and HOTP (HMAC-based One-Time Password) standards. It provides an interactive terminal dashboard where users can view all their 2FA codes, navigate with arrow keys, and copy codes to clipboard with a keypress.
The tool stores authentication secrets in an encrypted database file using XChaCha20Poly1305 authenticated encryption with Argon2id key derivation. Users can customize HMAC algorithms, digit counts, and other parameters to maintain compatibility with various 2FA systems. It includes built-in support for Steam, Yandex, and MOTP code formats beyond the standard RFC specifications.
cotp offers extensive migration capabilities from popular authenticator apps including Aegis, andOTP, Authy, Google Authenticator, Microsoft Authenticator, and FreeOTP. Many migrations require conversion scripts that transform proprietary backup formats into cotp's JSON import format. The tool supports both encrypted and unencrypted imports, with specific handling for Aegis encrypted backups using AES-GCM decryption.
Primarily targeting users who prefer command-line workflows or need 2FA access in terminal environments, cotp works across SSH sessions and provides JSON output for scripting integration. Database location can be customized via environment variables or command-line arguments, making it suitable for portable or shared system deployments.
# via Homebrew
brew install cotp
# via Cargo
cargo install cotp
