Thank you for sharing. My solution has been to dump small scripts like this in ~/bin:
#!/bin/sh set -eu k=$(pass ARG) oathtool -b --totp "$k"