#otp #command-line-tool #codes #email #messages #latest #extract

app otpget

A command-line tool for automatically retrieving OTP codes from email messages

3 releases

new 0.1.2 Jan 8, 2025
0.1.1 Jan 8, 2025
0.1.0 Jan 8, 2025

#250 in Authentication

Download history 101/week @ 2025-01-02

114 downloads per month

MIT license

19KB
257 lines

OTPGet

A simple command-line tool to extract OTP codes from your email inbox.

Installation

If you have Rust installed, you can install directly using cargo:

cargo install otpget

Don't have Rust? Install it first:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Manual Setup

  1. Place the otpget binary in a directory of your choice
  2. Run the setup wizard:
$ otpget --setup
  1. Enter your email credentials and IMAP server.
  2. You can now run otpget without the --setup flag.

Usage

Single Check

To check the latest emails once for OTP codes:

$ otpget

Continuous Monitoring

To continuously monitor for new OTP codes (checks every 3 seconds):

$ otpget --retry

Press Ctrl+C to stop monitoring.

Supported Email Providers

  • Yahoo Mail (default)
  • Gmail (use imap.gmail.com as IMAP_SERVER)
  • Other IMAP-compatible email providers (specify your provider's IMAP server)

Note

For Gmail users: You'll need to use an App Password instead of your regular password. Generate an App Password here

Dependencies

~11–28MB
~474K SLoC