在 macOS 上通过 SQLite 快速搜索 Apple Mail。按主题、发件人、日期、附件搜索电子邮件 - 结果约为 50 毫秒,而使用 AppleScript 则需要 8 分钟以上。当要求查找、搜索或列出电子邮件时使用。
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install apple-mail-search或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install apple-mail-search⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/apple-mail-search/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: apple-mail-search description: Fast Apple Mail search via SQLite on macOS. Search emails by subject, sender, date, attachments - results in ~50ms vs 8+ minutes with AppleScript. Use when asked to find, search, or list emails. homepage: https://github.com/steipete/clawdbot metadata: {"clawdbot":{"emoji":"📬","os":["darwin"],"requires":{"bins":["sqlite3"]}}} ---
Search Apple Mail.app emails instantly via SQLite. ~50ms vs 8+ minutes with AppleScript.
# Copy mail-search to your PATH
cp mail-search /usr/local/bin/
chmod +x /usr/local/bin/mail-search
mail-search subject "invoice" # Search subjects
mail-search sender "@amazon.com" # Search by sender email
mail-search from-name "John" # Search by sender name
mail-search to "[email protected]" # Search sent mail
mail-search unread # List unread emails
mail-search attachments # List emails with attachments
mail-search attachment-type pdf # Find PDFs
mail-search recent 7 # Last 7 days
mail-search date-range 2025-01-01 2025-01-31
mail-search open 12345 # Open email by ID
mail-search stats # Database statistics
-n, --limit N Max results (default: 20)
-j, --json Output as JSON
-c, --csv Output as CSV
-q, --quiet No headers
--db PATH Override database path
# Find bank statements from last month
mail-search subject "statement" -n 50
# Get unread emails as JSON for processing
mail-search unread --json | jq '.[] | .subject'
# Find all PDFs from a specific sender
mail-search sender "@bankofamerica.com" -n 100 | grep -i statement
# Export recent emails to CSV
mail-search recent 30 --csv > recent_emails.csv
| Method | Time for 130k emails | |--------|---------------------| | AppleScript iteration | 8+ minutes | | Spotlight/mdfind | Broken since Big Sur | | SQLite (this tool) | ~50ms |
Apple removed the emlx Spotlight importer in macOS Big Sur. This tool queries the Envelope Index SQLite database directly.
Database: ~/Library/Mail/V{9,10,11}/MailData/Envelope Index
Key tables:
messages - Email metadata (dates, flags, FKs)subjects - Subject linesaddresses - Email addresses and display namesrecipients - TO/CC mappingsattachments - Attachment filenamesLimitations:
For custom queries, use sqlite3 directly:
sqlite3 -header -column ~/Library/Mail/V10/MailData/Envelope\ Index "
SELECT m.ROWID, s.subject, a.address
FROM messages m
JOIN subjects s ON m.subject = s.ROWID
LEFT JOIN addresses a ON m.sender = a.ROWID
WHERE s.subject LIKE '%your query%'
ORDER BY m.date_sent DESC
LIMIT 20;
"
MIT
安装 苹果邮件搜索 后,可以对 AI 说这些话来触发它
Send a Slack message to the #engineering channel about the deployment
Formats and sends the message with relevant context, tagging the right people
Summarize all unread messages in my inbox from today
Reads messages across connected channels and returns a prioritized summary
Draft a reply to this customer complaint and send it for review
Writes an empathetic, professional response and routes it to the approval queue
将技能文件夹放到 ~/.claude/skills/apple-mail-search/ 目录(个人级,所有项目可用),或 .claude/skills/apple-mail-search/(项目级)。重启 AI 客户端后,用 /apple-mail-search 主动调用,或让 AI 根据上下文自动发现并使用。
苹果邮件搜索 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
苹果邮件搜索 可免费安装使用。请查阅仓库了解许可证信息。
在 macOS 上通过 SQLite 快速搜索 Apple Mail。按主题、发件人、日期、附件搜索电子邮件 - 结果约为 50 毫秒,而使用 AppleScript 则需要 8 分钟以上。当要求查找、搜索或列出电子邮件时使用。
苹果邮件搜索 属于「Communication」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。