
A simple and secure command-line tool for managing TOTP-based two-factor authentication codes.

Authy / Google Authenticator for the command line.
Hotpot is a simple and secure command-line tool for managing TOTP-based two-factor authentication codes. Hotpot securely stores your 2FA secrets in your system's keyring and generates time-based one-time passwords when you need them.
Built with Rust for security, performance, and reliability.
Clone this repo, and run
cargo install --path . --locked
hotpot add <account-name>
You will be prompted to enter the Base32 secret securely.
Example:
hotpot add github
Enter the Base32 secret: ********
hotpot --load-image /path/to/qr-code.png
Or use the interactive screenshot capture in the dashboard by pressing [A] then [S].
Just run hotpot to open the interactive dashboard where you can:
The dashboard automatically refreshes every 250ms and handles terminal resizing gracefully.
hotpot code <account-name>
Example:
hotpot code github
hotpot delete <account-name>
You can export a QR code for an account either through the dashboard (press [E]) or using the command:
hotpot export-qr --name <account-name>
This will display a QR code in the terminal that can be scanned by authenticator apps.
For portable configurations or when keyring access is unavailable, you can use the --file flag to store accounts in a JSON file instead of the secure keyring.
# Interactive dashboard with file storage
hotpot --file ~/.config/hotpot/accounts.json
# Add account to file
hotpot --file ./my-accounts.json add work-account
# Generate code from file-stored account
hotpot --file ./my-accounts.json code work-account
# Delete account from file
hotpot --file ./my-accounts.json delete work-account
Use cases for file-backed storage:
Security Note: File-backed storage stores secrets in plaintext JSON. Ensure proper file permissions (600) and consider encrypting the file for sensitive environments.
Default Secure Storage: Hotpot stores all secrets securely in your system's keyring:
File-Backed Storage: When using the --file flag, accounts are stored in a JSON file at the specified path. The file is created with appropriate permissions (600) and directories are created automatically if needed. This mode is useful for portable configurations or when keyring access is unavailable.
cargo build --release
The binary will be available at target/release/hotpot
The project includes comprehensive unit tests covering core functionality:
cargo test
Test coverage includes:
# Run in development mode
cargo run
# Run with specific arguments
cargo run -- add github
# Test with file storage
cargo run -- --file test-accounts.json add test-account
# Check code quality
cargo clippy
# Quick compile check
cargo check
Hotpot is built with a modular architecture focused on security and maintainability:
main.rs: CLI interface and storage managementtotp.rs: TOTP algorithm implementation (RFC 6238) with comprehensive test coveragedashboard.rs: Interactive terminal UI with real-time updates and extensive unit testslib.rs: Common error handling and shared utilitieskeyring, base32, hmac, sha1/sha2clap, crossterm, rpasswordfuzzy-matcher, qrcode, arboardserde, serde_json, url, urlencodingimage, (QR code detection)MIT License
Contributions are welcome! Please feel free to submit a Pull Request.
The project maintains high code quality standards:
cargo test)cargo clippy)rqrr