A Chrome extension that reads Gmail messages and generates AI-powered responses using OpenAI's Chat Completions API. Features intelligent email response generation and text correction with context menus and floating UI integration.
🎥 Watch the Demo - See the AI Email Helper in action!
🚀 Install from Chrome Web Store - Get the extension directly from the official Chrome Web Store!
- 🤖 AI-Powered Email Responses: Generate professional email responses using OpenAI's GPT-4o-mini model
- ✏️ Text Correction: Right-click on selected text to improve grammar, spelling, and style
- 📧 Gmail Integration: Seamlessly reads email content and inserts responses directly into Gmail
- 🎯 Multi-Tab Interface: Assistant, Instructions, and Settings tabs for organized workflow
- ⚙️ Customizable Instructions: Separate AI instructions for email responses and text corrections
- 🎨 Modern UI: Built with React and TailwindCSS with gradient design
- 🔒 Privacy Focused: All processing happens through your own OpenAI account
- 🧪 Testing Framework: Comprehensive test suite with Vitest and Testing Library
- OpenAI Account: You need an OpenAI account with API access
- OpenAI API Key: Get your API key from OpenAI Platform
- Chrome Browser: Extension requires Chrome or Chromium-based browser
# Install dependencies
npm install
# Build the extension
npm run build- Open Chrome and go to
chrome://extensions/ - Enable "Developer mode" (toggle in top right)
- Click "Load unpacked"
- Select the
distfolder from this project
- Click the extension icon in your browser toolbar
- Go to the "Settings" tab
- Enter your OpenAI API Key
- Click "Test Connection" to verify your API key
- Click "Save Settings"
- (Optional) Go to "Instructions" tab to customize AI behavior for email responses and text corrections
- Open Gmail and navigate to any email conversation
- Click the extension icon to open the popup
- Click "Generate Response" - the extension will automatically detect the email content
- Review the generated response in the popup
- Click "Insert to Gmail" to add the response to your compose area
- Select any text in Gmail (in compose area, email content, etc.)
- Right-click on the selected text
- Choose "✨ Improve with AI" from the context menu
- Watch as the text is corrected in real-time with visual feedback
- Multi-Tab Interface: Switch between Assistant, Instructions, and Settings
- Custom Instructions: Configure separate AI instructions for email responses and text corrections
- Copy Response: Copy generated responses to clipboard
- Multiple Emails: Extension reads the most recent email in conversation threads
- Real-time Feedback: Visual loading states and error handling for text corrections
- Floating Button: Quick access button appears on Gmail pages
The extension allows you to customize AI behavior through the Instructions tab:
Configure how the AI generates email responses:
You are a professional email assistant. Generate polite, professional, and helpful email responses. Keep responses concise but comprehensive. Maintain a friendly but professional tone. Don't include the subject line or the signature just the message body. Don't include any other text or commentary. Don't include quotation marks.
Configure how the AI improves selected text:
You are a professional writing assistant. Improve the given text by correcting grammar, spelling, and style while maintaining the original meaning and tone. Return only the corrected text without any additional commentary or quotation marks.
Tips for Better Instructions:
- Be specific about tone and style preferences
- Define the assistant's role and expertise level
- Include formatting requirements
- Specify desired response length
src/
├── popup/ # React popup interface
├── content/ # Gmail content script
├── background/ # Chrome extension background script
├── components/ # React components
│ ├── email-assistant/ # Email response generation components
│ ├── instructions/ # AI instruction management
│ └── settings/ # Configuration components
├── hooks/ # React hooks for API integration
├── styles/ # TailwindCSS styles
├── test/ # Test files and setup
└── utils/ # Utility functions
# Development build with CSS watching
npm run dev:all
# Development build (JavaScript only)
npm run dev
# Production build
npm run build
# CSS development with watching
npm run dev:css
# Type checking
npm run type-check
# Run tests
npm run test
# Run tests with UI
npm run test:ui
# Test coverage
npm run test:coverage- React 18: UI framework with hooks
- TypeScript: Type-safe development
- TailwindCSS: Utility-first CSS framework
- Webpack: Module bundling and build process
- Chrome Extensions Manifest V3: Extension platform
- OpenAI Chat Completions API: AI response generation using GPT-4o-mini
- Vitest: Testing framework
- Testing Library: React component testing
- No data storage: The extension doesn't store your email content
- Secure API calls: All OpenAI requests use HTTPS
- Local processing: Email reading happens locally in your browser
- Your API key: You control your own OpenAI account and usage
- Check that you're on
mail.google.com - Refresh the Gmail page
- Check the extension is enabled in
chrome://extensions/ - Close and reopen your browser completely
- Try disabling and re-enabling the extension
- Make sure you're viewing an email conversation
- Try clicking on the email to ensure it's selected
- Refresh the page and try again
- Verify your OpenAI API key is correct
- Check your OpenAI account has credits
- Test the connection in Settings
- Check browser console for detailed error messages
- Click in the compose text area first
- Make sure you have a compose window open
- Try copying the response and pasting manually
- Ensure text is properly selected before right-clicking
- Check that you're on a Gmail page
- Verify API key is configured in Settings
- Look for visual feedback (loading spinner, error messages)
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - see LICENSE file for details
For issues and questions:
- Check the troubleshooting section above
- Review Chrome extension console logs
- Check OpenAI API status
- Create an issue in this repository
Note: This extension requires your own OpenAI API key. Usage costs are based on your OpenAI plan and API usage. The extension uses the GPT-4o-mini model for cost-effective AI responses.