# Two-Factor Authentication Code Generator for Raycast

URL: https://www.raycast.com/cjdenio/two-factor-authentication-code-generator

> Generate TOTP 2FA codes for your accounts, copy or paste them, add accounts from otpauth:// URLs and back up and restore your codes.

- Install: raycast://extensions/cjdenio/two-factor-authentication-code-generator
- Author: [Caleb Denio](https://www.raycast.com/cjdenio)
- Installs: 7,401
- Platforms: macOS
- Updated: 2026-11-17
- Source: https://github.com/raycast/extensions/tree/c4e0f79975a011e16032382f2d1263f712f8b43c/extensions/two-factor-authentication-code-generator/

## Commands

- **Generate 2FA Code**: Quickly access your two-factor authentication codes.
- **Backup 2FA Codes**: Create a backup of your 2FA codes.
- **Restore 2FA Codes**: Restore your 2FA codes from a backup.

## README

<p align="center">
    <img src="https://github.com/raycast/extensions/raw/c4e0f79975a011e16032382f2d1263f712f8b43c/extensions/two-factor-authentication-code-generator//assets/command-icon.png" width="150" height="150" />
</p>

### Two-Factor Authentication Code Generator

Generate TOTP-powered 2FA login codes for any service that supports authenticator apps.

#### Features

- View live codes with a countdown for the current period
- Copy a code to the clipboard, or paste it into the focused app
- Add accounts manually or from an `otpauth://` URL
- Backup and restore your accounts

#### Copy vs Paste

Codes expire quickly, so pasting into the focused field is often better than copying.

- **Paste Code** inserts the code into the frontmost application (no need for ⌘V)
- **Copy Code** puts the code on the clipboard

Set which one Enter runs in extension preferences:

**Raycast Settings → Extensions → Two-Factor Authentication Code Generator → Default Action**

Choose **Paste** or **Copy**. The other action stays available as a secondary action.

#### Add an account

1. Run **Generate 2FA Code**
2. Use **Add App** (⌘G) and enter the name + secret, or **Add App by URL** (⌘U) with an `otpauth://` link

#### Backup and restore

- **Backup 2FA Codes** writes your accounts as `otpauth://` URLs to a text file (plain text — treat it as sensitive)
- **Restore 2FA Codes** imports accounts from a previous backup file
