GitHunt
KE

keithrozario/email-bot

Email bot

Email Bot

Setting up oAuth tokens for long lived access to Gmail.

Setup the consent screen on oAuth.

Setup Client

In GCP setup a OAuth 2.0 client. Save the credentials as credentials.json in the script folder.

Enable APIs

Applying terraform should be sufficient

$ cd terraform
$ tf apply --auto-approve

This does nothing more than enabling the APIs.

Run the Script

The script will run the and creates a token.json file, this file contains a refresh token that won't expire, provided your app is internal or published.

Languages

Python82.5%HCL17.5%

Contributors

Created February 6, 2026
Updated February 6, 2026