Background CLI utility that copies OTPs from Gmail to clipboard on hotkey trigger
Project description
OTPilot
Press a hotkey. Your OTP is already copied.
pip install otpilot
✈ OTPilot v2.1
The new era of private OTP fetching. Background utility that copies OTPs from Gmail to your clipboard with a single hotkey.
GitHub • Install • Quickstart • Supabase Auth Setup • Contributing
How It Works
- OTPilot sits silently in your system tray — no polling loop, runs only when needed.
- Press your hotkey (e.g.
Ctrl+Shift+O) or runotpilot fetch— OTPilot fetches recent Gmail emails and extracts an OTP. - OTP is copied to your clipboard — and optionally auto-pasted. A desktop notification confirms the action.
Installation
pip install otpilot
Requirements
- Python 3.8+
- Gmail account
- Supabase-backed auth endpoint (default is OTPilot hosted auth)
- OS: macOS, Windows, or Linux
Linux users: Make sure
xcliporxselis installed for clipboard support.sudo apt install xclip # Debian/Ubuntu
Quickstart
1. Configure Auth (if self-hosting)
For most users, no extra setup is required. OTPilot uses its hosted auth endpoint by default.
If you run your own OTPilot auth API, follow SETUP.md and set OTPILOT_AUTH_BASE_URL.
2. Run Setup
otpilot setup
The wizard will:
- Open your browser for Supabase Google sign-in
- Request Gmail read-only access
- Let you set your preferred hotkey
- Configure copy/paste and scan preferences
- Save your configuration and token locally
3. Start OTPilot
otpilot start
OTPilot runs in the background with a system tray icon. Press your hotkey whenever you need an OTP.
4. Daily Use
- Receive an OTP email in Gmail
- Press your hotkey (default:
Ctrl+Shift+O) or runotpilot fetch - Paste the OTP — done!
Authentication Setup
OTPilot uses Supabase Auth for Google OAuth.
- Hosted mode (default): run
otpilot setup - Self-hosted mode: deploy the auth API and set
OTPILOT_AUTH_BASE_URL - Complete browser auth and OTPilot stores your token locally
See SETUP.md for full instructions.
CLI Commands
| Command | Description |
|---|---|
otpilot setup |
Run or re-run the interactive setup |
otpilot start |
Start the background service |
otpilot fetch |
Trigger one OTP fetch immediately |
otpilot status |
Show auth state, hotkey, and config path |
otpilot hotkey |
View or reconfigure the global hotkey |
otpilot update |
Check PyPI and upgrade via pip |
otpilot version |
Print the version number |
Configuration
OTPilot stores its configuration at ~/.otpilot/config.json:
{
"hotkey": "ctrl+shift+o",
"notify_on_copy": true,
"otp_max_age_minutes": 10,
"email_fetch_count": 10,
"auto_paste": false,
"auto_start_on_boot": false,
"notification_sound": false,
"mask_otp_in_notification": true,
"check_updates_on_start": true,
"theme": "default",
"setup_complete": false
}
| Field | Type | Default | Description |
|---|---|---|---|
hotkey |
string | ctrl+shift+o |
Global hotkey combination |
notify_on_copy |
bool | true |
Show desktop notification when OTP is copied |
otp_max_age_minutes |
int | 10 |
Ignore emails older than this (minutes) |
email_fetch_count |
int | 10 |
Number of recent emails to scan |
auto_paste |
bool | false |
Auto-paste OTP after copying |
auto_start_on_boot |
bool | false |
Register OTPilot to start on login |
notification_sound |
bool | false |
Reserved for future sound behavior |
mask_otp_in_notification |
bool | true |
Mask middle OTP digits in notifications |
check_updates_on_start |
bool | true |
Check PyPI for updates on startup |
theme |
string | default |
Reserved for future UI themes |
setup_complete |
bool | false |
Indicates setup wizard completion |
Files Stored Locally
| File / Store | Purpose |
|---|---|
~/.otpilot/config.json |
Hotkey and runtime settings |
System keyring (otpilot) |
Preferred token storage |
~/.otpilot/token.json |
Fallback token storage |
Platform Support
| Platform | Status | Notes |
|---|---|---|
| macOS | ✅ | Full support |
| Windows | ✅ | Full support |
| Linux | ✅ | Requires xclip/xsel for clipboard |
How OTP Extraction Works
OTPilot scans the subject line and body of your recent emails for:
- 4–8 digit standalone numbers near context words like OTP, code, verify, verification, one-time, passcode, authentication
- Only emails within the configured time window are considered
- If multiple OTPs are found, subject matches are prioritized, then body matches
Security & Privacy
- OAuth via Supabase: browser sign-in is handled through Supabase Auth + Google provider.
- Read-only access: OTPilot only reads your emails — it cannot send, delete, or modify anything.
- Local storage only: OAuth token is stored in system keyring when available, otherwise
~/.otpilot/token.json. - On-demand fetching: Emails are fetched only when triggered by hotkey or
otpilot fetch.
Troubleshooting
| Issue | Solution |
|---|---|
| "Not authenticated" error | Run otpilot setup to re-authenticate |
| No OTP found | Check otp_max_age_minutes — the email might be too old |
| Clipboard not working (Linux) | Install xclip: sudo apt install xclip |
| Hotkey not working | Run otpilot hotkey or otpilot setup |
| Tray icon not visible | Check your system tray / menu bar settings |
| Update notice appears repeatedly | Run otpilot update or disable check_updates_on_start |
Contributing
Contributions are welcome! See CONTRIBUTING.md for guidelines on setting up the development environment, running tests, and submitting pull requests.
License
MIT — use it freely.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file otpilot-2.1.1.tar.gz.
File metadata
- Download URL: otpilot-2.1.1.tar.gz
- Upload date:
- Size: 28.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
817f0ea0f75ab25cde06d8749fcbda2bc844dc73291b1844cb0211538ab7fa2f
|
|
| MD5 |
2fdb2757c5a55549a44474b63f9b0da8
|
|
| BLAKE2b-256 |
b846e018ff6e61d43f454a8ebbae9d9852e33e51284ba1ba0960198348b700ca
|
File details
Details for the file otpilot-2.1.1-py3-none-any.whl.
File metadata
- Download URL: otpilot-2.1.1-py3-none-any.whl
- Upload date:
- Size: 29.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b29a9cac5781add04adaa3fbd5e90aa635bc707cb4766dfa102159936562cf89
|
|
| MD5 |
39da0e976ba668941dbd012ec83a8292
|
|
| BLAKE2b-256 |
a4cebe35d0dc55b73e5e927fc1ceb688b157a04197b3f101ab2de681d0b8d3ed
|