# rsc/2fa

Two-factor authentication on the command line

Repository: https://github.com/rsc/2fa
Canonical: https://ross.abutalabs.com/products/2fa
Language: Go
License: BSD-3-Clause
License Family: permissive
Last push: 2024-08-17T12:34:18+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 3207, "days_push": 746, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1963, forks 175 (observed 2026-08-28T04:05:59.740569+00:00)

## What it is
A command-line two-factor authentication agent written in Go that stores TOTP and HOTP keys and generates one-time authentication codes. Keys are managed in a simple local keychain file at $HOME/.2fa.

## Use cases
- generate 2FA codes from the terminal
- add GitHub two-factor secret to a CLI keychain
- print all current TOTP codes at once
- copy a one-time code to the clipboard
- manage HOTP counter-based tokens on the command line

## When to choose
- you want 2FA codes without leaving the terminal
- you prefer a minimal single-binary Go tool
- you need both TOTP and HOTP support with configurable code lengths

## When to avoid
- you need encrypted key storage (the keychain file is unencrypted)
- you prefer a GUI authenticator app
- you need QR-code scanning or cloud backup of secrets

## Facets
- artifact type: cli-tool
- maturity: stable
- function: auth, cli, security
- domain: security, developer-tools
- platform: cli, go
- tags: totp, hotp, two-factor-authentication, otp, keychain, command-line, macos, linux

## Member repositories
- rsc/2fa (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:59.740569+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:05:33.883740+00:00, confidence not recorded.
  - readme: https://github.com/rsc/2fa (fetched 2026-08-28T04:05:59.740569+00:00, sha ded2f88488bf)
- Data as of 2026-08-30T08:39:29.467469+00:00.
