diff --git a/bin/pass-otp b/bin/pass-otp new file mode 100755 index 0000000..2e01286 --- /dev/null +++ b/bin/pass-otp @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# TODO: check for pass + +key="$1"; shift +args=("$@") + +otp="$(pass "$key" | grep -Pi '^otp.*: ?.*$' | cut -d ':' -f 2 | sed 's/ //g')" +simple-otp "$otp" diff --git a/bin/simple-otp b/bin/simple-otp new file mode 100755 index 0000000..889fdc4 --- /dev/null +++ b/bin/simple-otp @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +# TODO: check for oathtool + +key="$1"; shift +args=("$@") + +oathtool --totp=sha1 -b "$key" "${args[@]}"