
Research
/Security News
Miasma Mini Shai-Hulud Hits ImmobiliareLabs npm Packages
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.
open-mail-cli
Advanced tools
A Powerful Email Client Built for AI Agents
Open Mail CLI is a complete local email infrastructure specifically designed for AI agents and automation tools. It provides a reliable, programmatic interface for email operations that AI agents can use autonomously:
These features are designed to make AI agents work with email reliably and efficiently:
--format flag supports Markdown, JSON, and HTML; Markdown tables are optimized for LLM context windows, JSON enables programmatic parsing--fields flag lets agents request only the data they need (e.g. --fields id,subject,from), reducing token usage and keeping responses focused--format json is set, errors are returned as structured JSON with error code, message, and category — agents can handle failures programmaticallymail-cli webhook registers HTTP endpoints or local scripts triggered on new email arrival, enabling agents to react to incoming mail in real-time/api/docs and OpenAPI spec at /api/openapi.json let agents discover and call HTTP APIs with full schema awareness--limit, --offset, --page with range annotations (Showing 1-20 of 150) help agents navigate large mailboxes without context overflow{{placeholders}}Open Mail CLI is available as an Agent Skill for AI coding agents (Claude Code, Cursor, etc.). Install the skill to give your agent the ability to send, receive, search, and manage emails.
npx skills add eric8810/open-mail-cli
Once installed, the agent can use mail-cli commands to handle email tasks autonomously — sending messages, checking inbox, managing contacts, and more.
# Clone the repository
git clone https://github.com/eric8810/open-mail-cli.git
cd open-mail-cli
# Install dependencies
npm install
# Link globally (optional)
npm link
# Interactive configuration wizard
mail-cli config
# Or configure manually
mail-cli config --set imap.host=imap.gmail.com
mail-cli config --set imap.port=993
mail-cli config --set smtp.host=smtp.gmail.com
mail-cli config --set smtp.port=465
# Sync your inbox
mail-cli sync
# List emails (with field selection and format control)
mail-cli list --format json --fields id,subject,from,date
# Read an email
mail-cli read 1
# Send an email
mail-cli send --to user@example.com --subject "Hello" --body "World"
# Search emails
mail-cli search "meeting"
# Register a webhook for new email events
mail-cli webhook add --url http://localhost:8080/on-new-mail --event new_email
# Start background sync daemon
mail-cli sync daemon start
# Start local server
mail-cli serve --port 3000
# Agent writes code to integrate
import requests
# Get unread emails
emails = requests.get('http://localhost:3000/api/emails?unread=true').json()
# Send email
requests.post('http://localhost:3000/api/emails/send', json={
'to': 'user@example.com',
'subject': 'Hello',
'body': 'World'
})
# Create a template
mail-cli template create --name "Meeting" \
--subject "Meeting on {{date}}" \
--text "Hi {{name}}, let's meet at {{time}}"
# Use the template
mail-cli template use 1 --var name=John --var time="2pm"
# Enable notifications
mail-cli notify enable
# Configure filters
mail-cli notify config --sender boss@company.com --important-only
# Test notifications
mail-cli notify test
# Export folder to MBOX
mail-cli export folder INBOX backup.mbox
# Import emails from EML
mail-cli import eml message.eml --folder INBOX
We welcome contributions! Whether it's:
Please read our Contributing Guide to get started.
This project is licensed under the MIT License - see the LICENSE file for details.
Built with ❤️ using these amazing open-source projects:
If you find this project useful, please consider giving it a ⭐!
Open Mail CLI 是一个专为 AI 代理和自动化工具设计的完整本地邮件基础设施。它为 AI 代理提供了可靠、可编程的邮件操作接口:
这些特性专为 AI Agent 可靠、高效地处理邮件而设计:
--format 支持 Markdown、JSON、HTML 三种格式;Markdown 表格针对 LLM 上下文窗口优化,JSON 便于程序化解析--fields 让 Agent 只获取所需数据(如 --fields id,subject,from),减少 token 消耗,保持响应精简--format json 时错误以结构化 JSON 返回(含错误码、消息、分类),Agent 可程序化处理异常mail-cli webhook 注册 HTTP 端点或本地脚本,新邮件到达时自动触发,Agent 可实时响应收件/api/docs)和 OpenAPI 规范(/api/openapi.json)让 Agent 自动发现和调用 HTTP API--limit、--offset、--page 配合范围标注(Showing 1-20 of 150),帮助 Agent 在大邮箱中导航而不溢出上下文{{占位符}} 变量替换Open Mail CLI 已作为 Agent Skill 发布,支持 AI 编程代理(Claude Code、Cursor 等)。安装此 skill 可赋予你的 agent 收发、搜索和管理邮件的能力。
npx skills add eric8810/open-mail-cli
安装后,agent 可以自主使用 mail-cli 命令处理邮件任务——发送消息、查看收件箱、管理联系人等。
# 克隆仓库
git clone https://github.com/eric8810/open-mail-cli.git
cd open-mail-cli
# 安装依赖
npm install
# 全局链接(可选)
npm link
# 交互式配置向导
mail-cli config
# 或手动配置
mail-cli config --set imap.host=imap.gmail.com
mail-cli config --set imap.port=993
# 同步收件箱
mail-cli sync
# 列出邮件(支持字段选择和格式控制)
mail-cli list --format json --fields id,subject,from,date
# 阅读邮件
mail-cli read 1
# 发送邮件
mail-cli send --to user@example.com --subject "你好" --body "世界"
# 搜索邮件
mail-cli search "会议"
# 注册新邮件事件的 Webhook
mail-cli webhook add --url http://localhost:8080/on-new-mail --event new_email
# 启动后台同步守护进程
mail-cli sync daemon start
# 启动本地服务器
mail-cli serve --port 3000
# Agent 编写代码集成
import requests
# 获取未读邮件
emails = requests.get('http://localhost:3000/api/emails?unread=true').json()
# 发送邮件
requests.post('http://localhost:3000/api/emails/send', json={
'to': 'user@example.com',
'subject': '你好',
'body': '世界'
})
我们欢迎各种形式的贡献:
请阅读我们的贡献指南开始参与。
本项目采用 MIT 许可证 - 详见 LICENSE 文件。
Built for AI agents, by developers
FAQs
A command-line email client with IMAP/SMTP support
The npm package open-mail-cli receives a total of 47 weekly downloads. As such, open-mail-cli popularity was classified as not popular.
We found that open-mail-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.

Security News
Rolldown paused Rust React Compiler integration after a 5MB binary size increase raised concerns about shipping React-specific code to all Vite users.

Security News
/Research
Mini Shai-Hulud expands into the Go ecosystem after hitting LeoPlatform npm packages and targeting GitHub Actions workflows.