pass-otp icon indicating copy to clipboard operation
pass-otp copied to clipboard

Added TOTP time remaining calc and printout

Open warricksothr opened this issue 6 years ago • 4 comments

In reference to feature request #94. I've added a TOTP time remaining calculation and the accompanying printout to TOTP code requests.

This adds a reliance on the system date program to print out the current unix time.

warricksothr avatar Dec 17 '18 20:12 warricksothr

So, I'm a little bit worried that echoing the time remaining universally would break existing tools/scripts that read the code.

Would you mind if I built upon this to echo in interactive terminals only?

tadfisher avatar Dec 17 '18 20:12 tadfisher

Would you mind if I built upon this to echo in interactive terminals only?

That absolutely seems reasonable.

warricksothr avatar Dec 17 '18 21:12 warricksothr

Would you mind if I built upon this to echo in interactive terminals only?

Maybe it should be added behind a flag, so it doesn't break existing tools/scripts but also won't keep them from implementing this as a feature.

I'd suggest pass otp [--time,-t] to print the remaing time. Also, adding : will make it easier to parse the output.

$ pass otp --time totp-secret
698816
Expires in: 26 seconds

brunelli avatar Feb 13 '19 12:02 brunelli

Would it make sense to send it to stderr instead of stdout?

davidfetter avatar Dec 08 '20 19:12 davidfetter