A minimal CLI for email control powered by AI. Process Gmail and Outlook emails with smart categorization and automated actions.
- 🤖 AI-Powered Analysis: Uses Claude 3.5 Sonnet to categorize emails and suggest actions
- 📧 Multi-Provider Support: Works with both Gmail and Outlook
- 🎯 Smart Actions: Delete, unsubscribe, create tasks, or skip emails based on AI recommendations
- 🎨 Rich Interface: Beautiful console interface with color-coded categories
- 📝 Task Management: Automatically creates tasks from action-required emails
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
cp .env.example .env # Edit .env with your API keys
-
Set up email authentication:
- Gmail: Download
credentials.json
from Google Cloud Console (see setup instructions in script) - Outlook: Configure Azure app registration (see setup instructions in script)
- Gmail: Download
-
Run the application:
python mailctl.py
The AI categorizes emails into:
- Important: Urgent or high-priority emails
- Newsletter: Subscriptions and newsletters
- Promotion: Marketing and promotional emails
- Transactional: Receipts, confirmations, notifications
- Spam: Unwanted or suspicious emails
- TaskRequest: Emails requiring action or follow-up
- Delete: Move email to trash
- Unsubscribe: Automatically unsubscribe using List-Unsubscribe headers
- Create Task: Add task to
tasks.md
file - Skip: Leave email as-is
- Quit: Exit the application
- Go to Google Cloud Console
- Create/select project and enable Gmail API
- Create OAuth 2.0 credentials for desktop application
- Download and save as
credentials.json
in project directory
- Go to Azure Portal
- Create app registration with Mail permissions
- Add client ID to
.env
file
- Python 3.7+
- Anthropic API key
- Gmail or Outlook account with API access
Never commit .env
, credentials.json
, or token.json
files to version control. These contain sensitive authentication data.