Automated CLI Export to JSON script

I’m trying to write a script I can automate to have a hands-off export of the entire vault contents.
It seems to break down once connected to my self-hosted server and the login stage starts… I have to pass the username and password, but the TOTP doesn’t seem to be circumvented. I thought exporting the session and using that as authentication would be a viable option, but either I’m missing something in the syntax or it just won’t work that way…

Any help would be most appreciated!

I’ll give it a try. Just let me know which OS are you.