A powerful command-line TOTP (Time-based One-Time Password) manager for secure two-factor authentication. Generate, manage, and sync your TOTP codes directly from your terminal.
- Generate TOTP codes compatible with Google Authenticator, Authy, and other 2FA apps
- Secure local SQLite database storage
- QR code scanning support
- Live refresh mode with real-time code updates
- Clipboard integration for quick code copying
- Cloud synchronization via Cloudflare KV
- Import/Export functionality for backup and migration
- Search and filter entries
- Update existing entries
- Database statistics and information
cargo install --path .Add a new TOTP entry with a secret key:
totp-console add <name> <secret> [issuer]Example:
totp-console add github JBSWY3DPEHPK3PXP GitHubDisplay all stored TOTP entries:
totp-console listGenerate TOTP code for a specific entry:
totp-console get <name>Example:
totp-console get githubGenerate and copy TOTP code to clipboard:
totp-console copy <name>Remove a TOTP entry:
totp-console delete <name>Update an existing entry's secret or issuer:
totp-console update <name> [--secret <secret>] [--issuer <issuer>]Examples:
totp-console update github --issuer "GitHub Inc"
totp-console update github --secret NEWSECRETKEYSearch for entries by name or issuer:
totp-console search <query>Example:
totp-console search gitContinuous refresh mode showing real-time TOTP codes:
totp-console loop [name]Examples:
totp-console loop # Show all entries
totp-console loop github # Show specific entryDisplay database statistics:
totp-console infoExtract TOTP configuration from QR code image:
totp-console read <image_path>Example:
totp-console read qrcode.pngBackup your TOTP entries to a JSON file:
totp-console export <file_path>Example:
totp-console export backup.jsonRestore TOTP entries from a JSON file:
totp-console import <file_path>Example:
totp-console import backup.jsonUpload entries to Cloudflare KV:
totp-console syncDownload entries from Cloudflare KV:
totp-console loadTo use cloud synchronization, create a KV namespace in your Cloudflare account and configure credentials using either:
Create a kv.json file:
{
"account_id": "your_account_id",
"namespace_id": "your_namespace_id",
"api_token": "your_api_token"
}export CF_ACCOUNT_ID=your_account_id
export CF_NAMESPACE_ID=your_namespace_id
export CF_API_TOKEN=your_api_token# Add a TOTP entry
totp-console add github JBSWY3DPEHPK3PXP GitHub
# Get current code
totp-console get github
# Update issuer
totp-console update github --issuer "GitHub Inc"
# Search entries
totp-console search git
# Export for backup
totp-console export ~/backups/totp-backup.json
# Import from backup
totp-console import ~/backups/totp-backup.json
# Live mode
totp-console loop github
# Sync to cloud
totp-console sync- TOTP secrets are stored locally in
totp.dbSQLite database - Keep your database file and exports secure
- Use strong passwords for your Cloudflare account if using cloud sync
- The
kv.jsonconfiguration file is automatically ignored by git
Run the test suite:
cargo testThe project includes comprehensive tests for:
- TOTP code generation (RFC 6238 compliant)
- Base32 decoding
- Time remaining calculations
This project is open source and available under the MIT License.