- Install
ykman
via homebrew on the Mac.
brew install ykman
- Create
bash
/zsh
function somewhere in your shell rc files
function otp() {
code=$(ykman oath accounts code <ACCOUNT_NAME_HERE> -s)
echo $code | tr -d '\n' | pbcopy
echo $code
}
- Call
otp
whenever you need a OTP. In my caseykman
asks me to touch my Yubikey and then provides the one-time code and usespbcopy
to place it in my clipboard right away.
- Add the account name as an arg on the function
- Add account-specific aliases