Bitwarden-cli login with Google authenticator as 2FA


I would like to use Bitwarden-cli to export my passwords periodically using a Bash script.

When I try to login, it asks me to enter the TOTP code which is normal since Google authenticator provider is activated but this step prevents me from automating the login process.

My question is: is it possible to get the 2FA code automatically or disable the 2FA from the terminal?

Disabling 2FA from the terminal would leave a gaping security hole. Even if it was optional, it wouldn’t be an ideal solution.

You could implement your own 2FA system with something like oauth-toolkit or similar. That’d be your best option, I think.

Thanks for your answer!

Yes, I’ve found out that the oauth-tookit is the way to go.

1 Like