*Every time I needed to log into something, the same thing happened:
*
- Enter email and password
- Wait for the OTP email
- Switch to Gmail
- Find the email
- Copy the 6-digit code
- Switch back
- Paste it before it expires
It's maybe 15 seconds. But it happens dozens of times a day, and it's
just annoying enough to break focus every single time.
So I built OTPilot.
What it does
OTPilot runs silently in the background. When you press a hotkey
(default: Ctrl+Shift+O), it:
- Fetches your last 10 emails from Gmail
- Finds the OTP
- Copies it to your clipboard
- Shows a desktop notification
That's it. No tab switching. No waiting. Just paste.
How to install
pip install otpilot
Requirements:
- Python 3.8+
- Gmail account
- Google Cloud project with Gmail API enabled (free, one-time 5 minute setup)
How to set it up
otpilot setup
The setup wizard walks you through:
- Importing your Google credentials
- One-time Gmail sign-in (OAuth — read-only access)
- Setting your preferred hotkey
Then run:
otpilot start
It sits in your system tray and waits.
Privacy
This was my main concern when building it.
- Your credentials never leave your machine
- Gmail access is read-only — it cannot send, delete, or modify anything
- Emails are fetched only when you press the hotkey — no background polling
- OAuth tokens are stored locally at ~/.otpilot/
The Google Cloud setup
The one friction point is the one-time Google Cloud setup to get a
credentials.json file. It takes about 5 minutes and the full guide is
in the repo. Once it's done, you never touch it again.
Platforms
Works on macOS, Linux, and Windows.
Linux users need xclip or xsel for clipboard support:
sudo apt install xclip
Links
- GitHub: https://github.com/codewithjenil/otpilot
- Website: https://jenil-otpilot.vercel.app
- Install: pip install otpilot
MIT licensed. Feedback and contributions welcome — especially around
OTP extraction patterns, since different services format their emails
differently.
Top comments (0)