All you need is the secret of your TOTP.
The QR code is just a representation of a oath://
URL
That URL contains the secret as a query parameter.
# Install oathtool
brew install oathtool
# Use your secret, e.g. as a base32-encoded string
oathtool --totp --base32 "MFRGCZDTMVRXEZLUBI======"