Unfolding Odyssey of Cognizance

oath-toolkit: Powerful CLI for generating TOTP

I was searching for the most simplest 2FA app for a limited use case in my work Mac. I explored several apps like Authy, KeePassXC, and Auth, but none could match the elegance of a command-line tool: oath-toolkit. This handy tool lets you generate one-time passwords (OTPs) for any account directly from the terminal.

Why oath-toolkit?

How?

  1. Install oath-toolkit: https://formulae.brew.sh/formula/oath-toolkit
  2. Find Your Secret Key: You can get your secret key from the original QR code that you scan using 2FA app if your app doesn’t have option to show or export existing one. You’ll need this to generate OTPs.
  3. Command Time! Here’s the key command:
alias otp = `oathtool -s 30 -b --totp=SHA1 YOUR_SECRET | pbcopy`

#tech