Skip to main content

🔐 TOTP Client for macOS

A lightweight, command-line utility written in Python to manage TOTP (Time-based One-Time Password) secrets securely on macOS using the native Keychain.

📌 Key Features

  • 🔒 Secure storage using macOS Keychain
  • 🧾 Add, delete, rename TOTP secrets
  • 🔎 Search and list stored accounts
  • 🔢 Generate and copy one-time passwords (OTPs)
  • 📱 Display QR codes for account setup
  • 📤 Export / 📥 Import secrets
  • 🎨 Colorized output and clipboard integration

💻 Requirements

Installation using pipx

pipx install pytotp-client

🔧 Usage

Add a new TOTP secret

# account name - can be any string, no restrictions here 
totp add <account> <secret>
# Example:
totp add google.com BBBBDDDD

Get one-time password (OTP)

totp get <pattenr>
# Example:
totp get google.com
# OTP will be printed and copied to clipboard

# you can use a search pattern here
totp get goo
# OTP for google.com will be printed here

Delete an account

totp delete <account>
# Example:
totp delete google.com

Rename an account

totp rename <old_account> <new_account>
# Example:
totp rename google.com gmail.personal

Search for an account

totp search <pattern>
# Example:
totp search goog
# List of accounts with substring goog will be printed

List all accounts

totp list

Generate Google Auth compatible QR code

totp qr <email> <account>
# Example:
totp qr me@example.com google.com
# QR code will be shown using the system viewer

Export all secrets

totp export > backup.txt

Import secrets

totp import < backup.txt

Show version

totp --version

🔐 Where are my secrets stored?

In the macOS default Keychain:

  • Service name: pytotp_client
  • Type: Application password

🧠 Tips

  • The first OTP shown by get is also copied to your clipboard.
  • Use export and import to backup/restore secrets between systems.
  • The app exits with a non-zero status code on failure, allowing scripting/integration.

Metadata

Release files for pytotp_client 0.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytotp_client 0.6.2
File Size Uploaded
pytotp_client-0.6.2.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytotp_client 0.6.2
File Interpreter ABI Platform
pytotp_client-0.6.2-py3-none-any.whl Python 3 none any Details

Total release size: 12.4 kB

Release files / pytotp_client-0.6.2.tar.gz

Download URL pytotp_client-0.6.2.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
839436752c86ae8af0125c99f2bd272d0bf49035c23e655661ef406e81a2f3ed
BLAKE2b-256 checksum
How to use checksums
3316bcb63742b3af81bcedd7dcbc2c35b27a37d956cc272ed34c56710a86c0a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.13.3 Darwin/24.3.0

Release files / pytotp_client-0.6.2-py3-none-any.whl

Download URL pytotp_client-0.6.2-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d7afc633480de818f8ae4cbb03620e917b4b803be25f6c4ce450e1f09904b0f
BLAKE2b-256 checksum
How to use checksums
540891e81c852b1154ddbcca65cad50ede55822a075efaf84f47143e619b03af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.13.3 Darwin/24.3.0

Release history Release notifications | RSS feed

This release

0.6.2 This release

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page