📧 Gmail AI
AI-enhanced Gmail for OpenClaw agents. Fork of gmail v1.0.6 with AI triage, priority scoring, smart replies, and email summarization.
What's New vs gmail
- - AI triage — auto-categorize emails (urgent/actionable/FYI/spam)
- Priority scoring — 0-100 score based on sender, subject, content
- Smart replies — context-aware reply generation in multiple tones
- Email summarization — TL;DR for long threads
- Send email — compose and send via SMTP
Requirements
| Variable | Required | Description |
|---|
| INLINECODE0 | ✅ | Your Gmail address |
| INLINECODE1 |
✅ | Gmail App Password (
create one) |
|
OPENROUTER_API_KEY | Optional | For AI triage, replies, and summaries |
Quick Start
CODEBLOCK0
Commands
inbox
Fetch emails from Gmail via IMAP.
- -
--unread — only unread messages - INLINECODE5 — Gmail label/folder (default: INBOX)
- INLINECODE6 — filter by sender
- INLINECODE7 — max results (default: 10)
- INLINECODE8 — emails since date
triage
AI-powered email categorization (requires
OPENROUTER_API_KEY).
- - Categories: 🔴 Urgent, 🟡 Actionable, 🔵 FYI, ⚪ Spam/Noise
- INLINECODE11 — number of emails to triage
priority
Score emails 0-100 based on sender importance, subject urgency, and content.
- -
--limit N — number of emails to score - Factors: known sender, urgency keywords, mentions of you, deadlines
summarize <message_id>
Generate a TL;DR summary of an email or thread.
reply <message_id>
Generate a context-aware reply draft.
- -
--tone professional|friendly|brief|formal — reply style - INLINECODE17 — additional context for the reply
send
Send email via SMTP.
- -
--to ADDRESS — recipient (required) - INLINECODE20 — subject line (required)
- INLINECODE21 — email body (required)
- INLINECODE22 — CC recipient
- INLINECODE23 — BCC recipient
Security Notes
- - Uses Gmail App Passwords (not OAuth) — simpler setup, works with 2FA
- App Password is NOT your Google password
- Create one at: Google Account → Security → 2-Step Verification → App Passwords
- IMAP must be enabled in Gmail settings
Credits
Built by
M. Abidi |
agxntsix.ai
YouTube |
GitHub
Part of the
AgxntSix Skill Suite for OpenClaw agents.
📅 Need help setting up OpenClaw for your business? Book a free consultation
📧 Gmail AI
面向OpenClaw代理的AI增强版Gmail。基于gmail v1.0.6分支,集成AI分类、优先级评分、智能回复和邮件摘要功能。
相比gmail的新特性
- - AI分类 — 自动归类邮件(紧急/待办/仅供参考/垃圾邮件)
- 优先级评分 — 基于发件人、主题、内容进行0-100分评分
- 智能回复 — 支持多种语气的上下文感知回复生成
- 邮件摘要 — 长邮件线程的要点总结
- 发送邮件 — 通过SMTP撰写和发送
环境要求
| 变量 | 必填 | 说明 |
|---|
| GMAILADDRESS | ✅ | 您的Gmail地址 |
| GMAILAPPPASSWORD |
✅ | Gmail应用密码(
创建方法) |
| OPENROUTER
APIKEY | 可选 | 用于AI分类、回复和摘要 |
快速开始
bash
获取最近未读邮件
python3 {baseDir}/scripts/gmail_ai.py inbox --unread --limit 10
按标签获取邮件
python3 {baseDir}/scripts/gmail_ai.py inbox --label INBOX --limit 20
获取特定发件人邮件
python3 {baseDir}/scripts/gmail_ai.py inbox --from boss@company.com
AI分类 — 邮件归类
python3 {baseDir}/scripts/gmail_ai.py triage --limit 20
优先级评分
python3 {baseDir}/scripts/gmail_ai.py priority --limit 20
摘要邮件线程
python3 {baseDir}/scripts/gmail
ai.py summarize id>
生成智能回复
python3 {baseDir}/scripts/gmailai.py reply id> --tone professional
python3 {baseDir}/scripts/gmailai.py reply id> --tone friendly
python3 {baseDir}/scripts/gmailai.py reply id> --tone brief
发送邮件
python3 {baseDir}/scripts/gmail_ai.py send --to recipient@example.com --subject Hello --body Message body
带抄送/密送发送
python3 {baseDir}/scripts/gmail_ai.py send --to a@b.com --cc c@d.com --subject Hello --body Message
命令说明
inbox
通过IMAP从Gmail获取邮件。
- - --unread — 仅未读邮件
- --label LABEL — Gmail标签/文件夹(默认:INBOX)
- --from ADDRESS — 按发件人筛选
- --limit N — 最大结果数(默认:10)
- --since YYYY-MM-DD — 自指定日期起的邮件
triage
AI驱动的邮件分类(需要OPENROUTERAPIKEY)。
- - 分类:🔴 紧急,🟡 待办,🔵 仅供参考,⚪ 垃圾/噪音
- --limit N — 待分类邮件数量
priority
基于发件人重要性、主题紧急程度和内容对邮件进行0-100分评分。
- - --limit N — 待评分邮件数量
- 考量因素:已知发件人、紧急关键词、提及您的内容、截止日期
summarize
生成邮件或线程的要点摘要。
reply
生成上下文感知的回复草稿。
- - --tone professional|friendly|brief|formal — 回复风格
- --context TEXT — 回复的额外上下文
send
通过SMTP发送邮件。
- - --to ADDRESS — 收件人(必填)
- --subject TEXT — 主题行(必填)
- --body TEXT — 邮件正文(必填)
- --cc ADDRESS — 抄送收件人
- --bcc ADDRESS — 密送收件人
安全说明
- - 使用Gmail应用密码(非OAuth)— 设置更简单,支持双重验证
- 应用密码不是您的Google密码
- 创建方法:Google账户 → 安全 → 两步验证 → 应用密码
- 需在Gmail设置中启用IMAP
致谢
由 M. Abidi 构建 | agxntsix.ai
YouTube | GitHub
属于面向OpenClaw代理的 AgxntSix技能套件 的一部分。
📅 需要为您的企业设置OpenClaw? 预约免费咨询