Does oathtool take stdin? Last time I looked it did not. I keep my TOTP secrets PGP encrypted and pipe them to goathgen.
$ gpg -d encrypted-secret.txt | goathgen
https://github.com/w8rbt/goathgen