Offline, Local-First
TOTP secrets live in your local encrypted vault; there is no cloud sync.
desktop‑2fa is an offline TOTP authenticator for people who want their second factor to live in a local encrypted vault. There is no cloud sync or account-based service.
It is CLI-first and includes an early Textual terminal UI prototype. The project uses password-based vault encryption, configurable vault paths, and commands for managing TOTP entries.
It does not replace hardware tokens or protect a compromised device. Review thesecurity model to understand its limits.
Requires Python 3.11 or newer. Install from PyPI:
python -m pip install desktop-2faOr install the command-line app with pipx:
pipx install desktop-2faBasic usage:
# Create a vault and add a TOTP entry
d2fa vault init
d2fa add GitHub GitHub JBSWY3DPEHPK3PXP
# Generate a code
d2fa code GitHub
# List all entries
d2fa listTOTP secrets live in your local encrypted vault; there is no cloud sync.
AES-256-GCM authenticated encryption with Argon2id password-based key derivation.
Generate time-based one-time passwords using RFC 6238.
A full command-line interface plus an early Textual UI prototype for viewing and copying codes.
Copy generated codes with the CLI's --copy or --copy-only options.
Choose a vault with --vault or DESKTOP_2FA_VAULT; zxcvbn evaluates password strength.
Use the default local vault or select another path with --vault or DESKTOP_2FA_VAULT.
Use d2fa add to store an account's TOTP secret in the encrypted vault.
Run d2fa code <name>; use --copy or --copy-only to copy the code.
Create an encrypted backup with d2fa backup and store it somewhere safe. Backups are not automatic.
Desktop-2FA does not protect secrets on a compromised device or while they are in use. See the security model and threat limits.
# Add a new entry (example secret)
d2fa add GitHub GitHub JBSWY3DPEHPK3PXP
# Generate a code
d2fa code GitHub --copy
# List entries
d2fa list
# Create an encrypted backup
d2fa backupSee the CLI reference for vault options and other commands.
| Choice | What it means |
|---|---|
| Local vault, no cloud sync | You manage backups and transfers; there is no account-based synchronization. |
| CLI-first | The complete feature set is exposed through command-line commands; the Textual UI is an early prototype. |
| Python package | Install with pip or pipx; Python 3.11 or newer is required. |
| Password recovery | There is no password reset. Users are responsible for keeping a recoverable, securely stored backup. |
This describes desktop-2fa's documented design and trade-offs, not a ranking against other authenticators.
d2fa ui). The prototype can list entries, generate codes, and copy codes, but does not manage entries or create a missing vault.otpauth:// URLs with d2fa add. QR scanning is not listed as a current feature.~/.desktop-2fa/vault. Choose another file with --vault or set DESKTOP_2FA_VAULT.Desktop-2FA is at version 0.8.3. The CLI is the primary interface; the Textual terminal UI is explicitly an early prototype, not a full desktop GUI.
d2fa ui prototype for listing entries, generating codes, and copying them