An open API service indexing awesome lists of open source software.

https://github.com/smartlegionlab/smart-2fa-manager-cli

Lightweight, offline, independent TOTP 2FA manager for Linux.
https://github.com/smartlegionlab/smart-2fa-manager-cli

2fa-client 2fa-client-python 2fa-totp alexander-suvorov smart-2fa-manager smartlegionlab

Last synced: about 1 month ago
JSON representation

Lightweight, offline, independent TOTP 2FA manager for Linux.

Awesome Lists containing this project

README

          

# Smart 2FA Manager (Cli) v1.1.0

---

**Lightweight, offline, independent TOTP 2FA manager for Linux.**

---

[![GitHub top language](https://img.shields.io/github/languages/top/smartlegionlab/smart-2fa-manager-cli)](https://github.com/smartlegionlab/smart-2fa-manager-cli)
[![GitHub license](https://img.shields.io/github/license/smartlegionlab/smart-2fa-manager-cli)](https://github.com/smartlegionlab/smart-2fa-manager-cli/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/v/release/smartlegionlab/smart-2fa-manager-cli)](https://github.com/smartlegionlab/smart-2fa-manager-cli/)
[![GitHub stars](https://img.shields.io/github/stars/smartlegionlab/smart-2fa-manager-cli?style=social)](https://github.com/smartlegionlab/smart-2fa-manager-cli/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/smartlegionlab/smart-2fa-manager-cli?style=social)](https://github.com/smartlegionlab/smart-2fa-manager-cli/network/members)

---

No cloud, no phone required. Store your secrets locally, generate codes, create encrypted backups, and sync with Google Authenticator via QR codes.

---

## ⚠️ Disclaimer

**By using this software, you agree to the full disclaimer terms.**

**Summary:** Software provided "AS IS" without warranty. You assume all risks.

**Full legal disclaimer:** See [DISCLAIMER.md](DISCLAIMER.md)

---

## Installation

### Dependencies

```bash
# Arch Linux
sudo pacman -S oath-toolkit gnupg qrencode python

# Debian/Ubuntu
sudo apt install oathtool gpg qrencode python3

# Fedora/RHEL
sudo dnf install oathtool gnupg2 qrencode python3
```

### Setup

1. Get the script from repository:
```bash
cd ~
git clone https://github.com/smartlegionlab/smart-2fa-manager-cli.git
cd smart-2fa-manager-cli
```

Or download directly:
```bash
wget https://raw.githubusercontent.com/smartlegionlab/smart-2fa-manager-cli/main/2fa.py
```

2. Install:
```bash
chmod +x 2fa.py
sudo cp 2fa.py /usr/local/bin/2fa.py
```
Important! This command `2fa.sh init` should only be run on first launch!!! If you already have a .2FA folder created earlier that already stores your services, initialization is not required; you can start using the application immediately.
Run only if you don't have a `~/.2fa` folder and haven't previously initialized using other similar applications or added services!

Now you can use:
```bash
2fa.py init
```

---

## Quick Start

```bash
# Important! This command `2fa.sh init` should only be run on first launch!!! If you already have a .2FA folder created earlier that already stores your services, initialization is not required; you can start using the application immediately.
# Run only if you don't have a `~/.2fa` folder and haven't previously initialized using other similar applications or added services!
# Initialize storage (creates encrypted ~/.2fa/secrets.gpg)
2fa.py init

# Add a service (secret from website QR code)
2fa.py add github JBSWY3DPEHPK3PXP

# Get TOTP code (auto-copies to clipboard)
2fa.py get github

# Show all services with current codes
2fa.py show-all

# Export QR code to phone (Google Authenticator / Aegis)
2fa.py qr github

# Create encrypted backup (saved to ~/.2fa/backups/)
2fa.py backup

# Restore from backup
2fa.py restore ~/.2fa/backups/secrets.2026-04-06.gpg

# Show version
2fa.py version

# Show author and repository info
2fa.py about
```

---

## Commands

| Command | Description |
|---------|-------------|
| `init` | Create encrypted storage |
| `add ` | Add a new service |
| `get ` | Generate TOTP code (copies to clipboard) |
| `list` | List all service names |
| `show-all` | List all services with current codes |
| `del ` | Delete a service |
| `show` | Show all secrets in plain text (⚠️ unsafe) |
| `qr ` | Show QR code to scan with phone |
| `backup` | Create encrypted backup with timestamp |
| `restore ` | Restore from encrypted backup |
| `about` | Show author, repository and license info |
| `version` | Show version number |
| `help` | Show help message |

---

## File Structure

```
~/.2fa/
├── secrets.gpg # Encrypted master storage
└── backups/
└── secrets.2026-04-06_14-30-00.gpg
```

---

## How It Works

- **Secrets are stored locally** in `~/.2fa/secrets.gpg` (AES-256 encrypted with GPG)
- **No internet connection required** - codes generated locally using `oathtool`
- **Backups are encrypted** with the same password
- **QR codes** let you import secrets into Google Authenticator / Aegis
- **Lost your phone?** Just re-scan QR codes from your Linux machine

---

## Security Notes

- Your GPG password is never stored
- Backup files are encrypted with the same password
- `2fa.py show` displays all secrets in plain text - use in secure environment only
- Keep backups in a safe place (encrypted USB drive, offline storage)

---

## Author & Repository

- **Author:** [@smartlegionlab](https://github.com/smartlegionlab/)
- **Repository:** [smartlegionlab/smart-2fa-manager-cli](https://github.com/smartlegionlab/smart-2fa-manager-cli)
- **Bash version:** [smartlegionlab/smart-2fa-manager-bash](https://github.com/smartlegionlab/smart-2fa-manager-bash)
- **Python GUI version:** [smartlegionlab/smart-2fa-manager-desktop](https://github.com/smartlegionlab/smart-2fa-manager-desktop)
- **License:** [BSD 3-Clause](LICENSE)

---

## License

**License:** [BSD 3-Clause](LICENSE)

---