Extract text from an image or screenshot and ask the AI from your own configuration.
Before running this application, you must create a .env file in the root directory of the project. This file contains sensitive configuration variables that the application needs to function properly.
Create a .env file in the root directory and add the following variables:
# Gemini AI Configuration
GEMINI_API_KEY=your_gemini_api_key_here
# Email Configuration (Gmail)
EMAIL=your_gmail_address@gmail.com
PASSWORD=your_gmail_app_password
TO_EMAIL=recipient_email@example.com
# Screenshot Monitoring
SCREENHOT_PATH=/path/to/your/screenshots/folder
FUNCTION_INTERVAL=5000
INTERVAL=5000-
GEMINI_API_KEY:
- Visit Google AI Studio
- Generate an API key for Gemini AI
-
EMAIL & PASSWORD:
- Use your Gmail address for EMAIL
- For PASSWORD, use an App Password (not your regular Gmail password)
- Enable 2-factor authentication on your Google account
- Generate an App Password: Google Account Settings
-
TO_EMAIL:
- The email address where you want to receive the AI analysis results
-
SCREENHOT_PATH:
- The full path to the folder where your screenshots are saved
- Example:
/Users/yourusername/Desktop/Screenshots
-
FUNCTION_INTERVAL & INTERVAL:
- Time in milliseconds between screenshot checks
- Default: 5000 (5 seconds)
GEMINI_API_KEY=AIzaSyD...your_actual_api_key_here...XYZ
EMAIL=yourname@gmail.com
PASSWORD=abcd efgh ijkl mnop
TO_EMAIL=recipient@example.com
SCREENHOT_PATH=/Users/yourname/Desktop/Screenshots
FUNCTION_INTERVAL=5000
INTERVAL=5000- Clone this repository
- Run
npm installto install dependencies - Create your
.envfile with the required variables (see above) - Run
npm startto start the application
The application will monitor your screenshots folder and automatically:
- Extract text from new screenshots using OCR
- Send the text to Gemini AI for analysis
- Email you the AI's response
- Never commit your
.envfile to version control - it contains sensitive information - The
.envfile should be in your.gitignorefile - Make sure your screenshot path exists and is accessible
- Gmail requires an App Password, not your regular password