|
1 | 1 | # PyAte (Python Authenticator Token Extractor) |
2 | | -PYATE is a lightweight and efficient Command-Line Interface (CLI) application, built with Python, that serves as a replacement for Google Authenticator. It lets you manage and generate Time-based One-Time Passwords (TOTP) for various accounts directly from your terminal. Instead of manually scanning a QR code, PYATE reads a list of `otpauth://` addresses from a text file (accounts.txt), allowing you to manage multiple accounts at once. |
| 2 | +PyAte is a lightweight and efficient Command-Line Interface (CLI) application built with Python. It serves as a powerful replacement for Google Authenticator, allowing you to manage and generate Time-based One-Time Passwords (TOTP) directly from your terminal. |
3 | 3 |
|
4 | | -## Key Features |
5 | | -Multi-Account Support: Manage multiple TOTP accounts from one place using a simple list in a text file. |
| 4 | +Instead of manually scanning QR codes, PyAte reads a list of `otpauth://` addresses from a text file (accounts.txt), making it easy to manage multiple accounts at once. |
6 | 5 |
|
7 | | -* **Clean CLI Display**: The terminal output automatically refreshes every 30 seconds to show a valid OTP code. |
| 6 | +## ✨ Key Features |
| 7 | +* **Multi-Account Support**: Manage all your TOTP accounts from one central place. |
8 | 8 |
|
9 | | -* **Dynamic Time Updates**: A countdown of the remaining time updates every second on the same line, providing an experience similar to the original app. |
| 9 | +* **Clean CLI Display**: The terminal output automatically refreshes every 30 seconds to show a valid OTP code. |
10 | 10 |
|
11 | | -* **Automatic Screen Clearing**: The terminal screen is cleared and fully refreshed when the OTP code changes, ensuring no old text is left behind. |
| 11 | +* **Dynamic Time Updates**: A countdown of the remaining time updates every second, providing an experience similar to the original app. |
12 | 12 |
|
13 | | -* **Automatic Copy**: The OTP code for the first account is automatically copied to the clipboard for easy pasting. |
| 13 | +* **Automatic Copy**: The OTP code for the first account is automatically copied to your clipboard for easy pasting. |
14 | 14 |
|
15 | 15 | * **Cross-Platform Compatibility**: Works seamlessly on Windows, macOS, and Linux. |
16 | 16 |
|
17 | 17 | * **Migration Import**: Automatically imports all accounts from a Google Authenticator migration QR code, simplifying the setup process. |
18 | 18 |
|
19 | | -* **YubiKey Support**: Can generate ykman commands directly from a migration URI, making it easy to import TOTP accounts to a YubiKey device. |
| 19 | +* **YubiKey Support**: Generates ykman commands directly from a migration URI, making it easy to import TOTP accounts to a YubiKey device. |
20 | 20 |
|
21 | | -## Additional (Argument-Based) Features |
22 | | -PyAte has been updated to include argument-based features, providing more control and flexibility. |
| 21 | +* **Export to QR Codes**: **(New!)** Generates individual QR code images for accounts from a specified file, saving them to a qrcodes directory for backup or transfer. |
23 | 22 |
|
24 | | -## How to Use |
25 | | -Make sure you have installed the required libraries. |
| 23 | +## 🛠️ How to Use |
| 24 | +**1. Installation** |
| 25 | +First, make sure you have Python installed. Then, install the required libraries: |
26 | 26 |
|
27 | 27 | ```bash |
28 | 28 | pip install -r requirements.txt |
29 | 29 | ``` |
30 | | -Create an Accounts File: Create a file named accounts.txt in the same directory as the program. Enter the `otpauth://` address for each account on a separate line. |
31 | 30 |
|
32 | | -### Example of accounts.txt content |
33 | | -otpauth://totp/GitHub:your-username?secret=ANOTHER_SECRET_KEY&issuer=GitHub |
| 31 | +**2. Setup** |
| 32 | +Create a file named accounts.txt in the same directory as the program. Add the otpauth:// address for each of your accounts on a separate line. |
| 33 | +Example accounts.txt content: |
34 | 34 |
|
35 | | -## Run the Application: |
| 35 | +`otpauth://totp/GitHub:your-username?secret=ANOTHER_SECRET_KEY&issuer=GitHub` |
36 | 36 |
|
37 | | -### Normal Mode |
38 | | -Displays all OTPs and automatically copies the first one. |
39 | | -```bash |
40 | | -python pyate.py |
41 | | -``` |
42 | | - |
43 | | -### Import Migration |
44 | | -This feature allows you to import multiple TOTP accounts at once from a Google Authenticator migration QR code. This is extremely useful for transferring all accounts from your Google Authenticator app on your phone. |
| 37 | +**3. Run the Application** |
| 38 | +Run the application with the basic command: |
45 | 39 |
|
46 | 40 | ```bash |
47 | | -python pyate.py --import-migration path/to/qrcode.png |
48 | | -``` |
49 | | -`--import-migration`: Use this argument followed by the path to the migration QR code image file. PyAte will scan the image, extract all OTP URIs, and add them to the accounts.txt file. |
50 | | - |
51 | | -### Save to a Custom File |
52 | | -You can combine `--import-migration` with `--output-file` to save the imported URIs to a different file, like `new_accounts.txt`. |
53 | | - |
54 | | -```bash |
55 | | -python pyate.py --import-migration path/to/qrcode.png --output-file new_accounts.txt |
56 | | -``` |
57 | | - |
58 | | -### Generate YubiKey Manager (ykman) Commands |
59 | | -This feature converts the migration URI extracted from a QR code or a direct URI into ready-to-run ykman commands. This is ideal for users who want to import their TOTP accounts from Google Authenticator directly to their YubiKey device. |
60 | | - |
61 | | -```bash |
62 | | -python pyate.py --generate-ykman path/to/qrcode.png |
63 | | -``` |
64 | | -This command will scan the QR code, extract the OTP URIs, and print a series of ykman commands to the terminal. You can simply copy and paste these commands to import your accounts into your YubiKey. |
65 | | - |
66 | | -### Interactive Mode |
67 | | -Choose which account's OTP to copy. |
68 | | - |
69 | | -```bash |
70 | | -python pyate.py --interactive |
71 | | -``` |
72 | | - |
73 | | -### Search Mode |
74 | | -The `--search` argument allows you to filter accounts and only display the OTP for accounts that match the keyword you enter. This is very useful when you have many accounts in your file and only want to see one or a few specific ones. |
75 | | - |
76 | | -```bash |
77 | | -python pyate.py --search "google" |
78 | | -``` |
79 | | -Example: If your `accounts.txt` file contains accounts for Google and GitHub, the command python pyate.py `--searc`h "google" will filter the list and only show the OTP for the Google account. This command will produce an output like this: |
80 | | - |
81 | | -``` |
82 | | -1 accounts loaded from 'accounts.txt'. |
83 | | -
|
84 | | -[Google: your-email] OTP: 123456 |
85 | | -
|
86 | | -Remaining Time: 25s |
| 41 | +python pyate.py |
87 | 42 | ``` |
| 43 | +This will display all your OTPs and automatically copy the first one to your clipboard. |
88 | 44 |
|
89 | | -### Use a Custom File |
90 | | -By default, PyAte will read accounts from the accounts.txt file. However, with the --read argument, you can specify another text file to load OTP accounts from. This allows you to manage multiple sets of accounts separately without having to change the main file. |
91 | | -Example: If you have a file named auth.txt and you want PyAte to load accounts from there, use the command: |
92 | | - |
93 | | -```bash |
94 | | -python pyate.py --read auth.txt |
95 | | -``` |
| 45 | +## 🚀 Advanced Features (Arguments) |
| 46 | +PyAte includes various arguments for more control and flexibility. |
96 | 47 |
|
97 | | -### View Help Page |
98 | | -The `--help` argument displays a brief description of the program and all available arguments, complete with explanations. This is a quick way to get a summary of all the features supported by PyAte directly in your terminal. |
| 48 | +| Argumen | Description | |
| 49 | +|---|---| |
| 50 | +|`--import-migration <path_to_image>` | Scans a Google Authenticator migration QR code and adds all URIs to accounts.txt. | |
| 51 | +|`--output-file <filename.txt>` | Use with --import-migration to save the imported URIs to a custom file. | |
| 52 | +|`--generate-ykman <path_to_image>` | Converts URIs from a QR code into ready-to-run ykman commands for YubiKey. | |
| 53 | +|`--export <filename.txt>` | Generates individual QR code images for each account in the specified file (defaults to accounts.txt). | |
| 54 | +|`--interactive` | Runs in interactive mode, allowing you to choose which account's OTP to copy. | |
| 55 | +|`--search <keyword>` | Filters and displays the OTP only for accounts that match your keyword. | |
| 56 | +|`--read <filename.txt>` | Loads accounts from a custom file instead of accounts.txt. | |
| 57 | +|`--help` | Displays a brief description of the program and all available arguments. | |
99 | 58 |
|
100 | | -**Example** |
101 | | -``` |
102 | | -python pyate.py --help |
103 | | -``` |
| 59 | +## 🤝 Contribution |
| 60 | +If you're interested in contributing, please check out the CONTRIBUTING.md file or feel free to open an issue on our GitHub repository. |
0 commit comments