CLI reference

Every tofa subcommand documented in one place. Auto-generated synopsis and flags are kept in sync with the source by an xtask tool — they cannot drift.

Global options

These work on every subcommand:

FlagDescription
--vault <PATH>Override the vault path. Reads from TOFA_VAULT env var as fallback.
--help, -hPrint help.
--version, -VPrint the version.

Environment variables

VariableEffect
TOFA_VAULTDefault vault path when --vault is not given.
TOFA_PASSPHRASEIf set, used instead of an interactive prompt. Avoid in productiontofa prints a warning to stderr when it reads this.

Commands

CommandPurpose
initCreate a new encrypted vault.
listList every account.
codePrint the current TOTP code for one account.
addAdd an account from secret, URI, or QR.
removeRemove an account.
renameRename an account.
qrPrint a QR code for one account or all.
rekeyChange the vault passphrase.
exportDump every account as JSON or as a list of otpauth:// URIs.
importImport from any supported file: single- or multi-QR images, migration QRs, JSON / CSV / TXT exports from other authenticators, or a zip archive of any of the above.
scanCapture every connected display and import every QR visible on screen.
camOpen the webcam and wait for a QR.
completionsPrint shell completions.
destroyPermanently delete the vault.