import otp import os const codeUsage* = """Usage: totptool code This will generate a TOTP code for the given secret name in the secret store. """ proc code*(root: string, args: seq[string]) = try: var keyFileName = args[0] fin = open root / keyFileName key = fin.readLine totp = newTotp key echo totp.now() except: echo getCurrentExceptionMsg() quit "Couldn't do that for " & args[0] & ". Does that machine exist in the store?"