cp ./run.sh.example ./run.sh
and edit the keys. Then run
Failed approaches can be found in
Please note that this code implements a minimal OAuth2 exchange for "installed applications". E.g. it does not use any Google API client libraries, and does not store the refresh token.