A Gemini CLI extension that sends an email notification via Gmail when a long task completes.
- Python 3.x
- A Google Cloud Console project with the Gmail API enabled.
-
Dependencies: Install the required Python packages:
pip install -r requirements.txt
-
Google OAuth Setup (Step-by-Step):
- Go to the Google Cloud Console Credentials page.
- Create/Select Project: Ensure you have a project selected in the top bar.
- Enable Gmail API: Click "Library" on the left, search for "Gmail API", and click "Enable".
- Consent Screen:
- Go to "OAuth consent screen".
- Choose "External".
- Fill in "App name" (e.g., Gemini Notifier) and your email.
- Important: In the "Test users" section, click "ADD USERS" and add your own Gmail address.
- Create Credentials:
- Go to the "Credentials" tab.
- Click "+ CREATE CREDENTIALS" -> "OAuth client ID".
- Select "Desktop App" as the type.
- Click "Create", then "DOWNLOAD JSON" on the next screen.
- File Placement: Rename the downloaded file to
client_secret.jsonand place it in the root of thegemini-email-notifier/folder.
-
Login: Authenticate the extension with your Google account by running the following command in the Gemini CLI:
/email:loginThis will open a browser window for authentication. Once completed, a
token.jsonfile will be created in the extension root. -
Automatic Notifications: Once logged in, the extension automatically hooks into
AfterAgent. Whenever a task finishes, you will receive an email at your authenticated Gmail address with the subject "Gemini Task Finished".
gemini-extension.json: Extension metadata and command registration.commands/login.py: Handles OAuth 2.0 authentication.hooks/hooks.json: Registers theAfterAgenthook.hooks/notify.py: Implementation of the email notification logic.