Email Reader
Lee correos de Gmail usando el CLI gog. Requiere que gog auth esté
configurado. Si no lo está, ejecuta el setup primero.
Setup inicial (solo una vez)
CODEBLOCK0
Cuándo usar esta skill
- - "Revisa mi correo"
- "¿Qué correos nuevos tengo?"
- "Muéstrame los no leídos de hoy"
- "Lee los correos de Juan"
- "Busca correos sobre la propuesta del Q1"
- "¿Cuántos correos de spam tengo?"
- "Muéstrame el hilo de [asunto]"
- "Lee la carpeta Clientes"
Comandos principales
Leer inbox (correos recientes)
CODEBLOCK1
Leer spam
CODEBLOCK2
Leer una carpeta/etiqueta específica
CODEBLOCK3
Buscar correos
CODEBLOCK4
Filtros de tiempo útiles
| Filtro | Significado |
|---|
| INLINECODE2 | último día |
| INLINECODE3 |
última semana |
|
newer_than:30d | último mes |
|
older_than:180d | más de 6 meses |
|
after:2026/01/01 | desde fecha exacta |
Presentación de resultados
Después de obtener el JSON, presenta un resumen claro al usuario:
CODEBLOCK5
Múltiples cuentas
Si el usuario tiene más de una cuenta de Gmail:
CODEBLOCK6
Notas importantes
- - Usar siempre
--json para obtener datos estructurados - Usar
--no-input en modo automático/cron para evitar prompts interactivos - El flag
--max limita resultados; aumentar si el usuario quiere más - Los resultados de búsqueda de Gmail usan la misma sintaxis que gmail.com
Email Reader
使用 CLI 工具 gog 读取 Gmail 邮件。需要先配置 gog auth。如果尚未配置,请先执行初始设置。
初始设置(仅需一次)
bash
gog auth credentials /path/to/client_secret.json
gog auth add $GOG_ACCOUNT --services gmail
gog auth list # 验证配置是否成功
何时使用此技能
- - 查看我的邮件
- 我有多少新邮件?
- 显示今天未读的邮件
- 读取 Juan 的邮件
- 搜索关于第一季度提案的邮件
- 我有多少垃圾邮件?
- 显示 [主题] 的邮件线程
- 读取客户文件夹
主要命令
读取收件箱(最近邮件)
bash
gog gmail search in:inbox newer_than:1d --max 20 --json
gog gmail search in:inbox is:unread --max 50 --json
gog gmail search in:inbox newer_than:7d --max 100 --json
读取垃圾邮件
bash
gog gmail search in:spam newer_than:30d --max 50 --json
读取特定文件夹/标签
bash
系统标签
gog gmail search in:sent newer_than:7d --max 20 --json
gog gmail search in:drafts --max 20 --json
gog gmail search in:trash newer_than:30d --max 20 --json
gog gmail search is:starred --max 20 --json
自定义标签(用户文件夹)
gog gmail search label:Clientes newer_than:30d --max 20 --json
gog gmail search label:Proyectos --max 20 --json
gog gmail search label:Facturas newer_than:90d --max 20 --json
搜索邮件
bash
按发件人
gog gmail search from:juan@empresa.com newer_than:30d --max 20 --json
按主题
gog gmail search subject:propuesta --max 10 --json
按内容
gog gmail search propuesta presupuesto 2026 --max 10 --json
组合搜索
gog gmail search from:ceo@empresa.com is:unread newer_than:7d --max 10 --json
带附件
gog gmail search has:attachment in:inbox newer_than:7d --max 10 --json
有用的时间筛选
| 筛选条件 | 含义 |
|---|
| newerthan:1d | 最近一天 |
| newerthan:7d |
最近一周 |
| newer_than:30d | 最近一个月 |
| older_than:180d | 超过6个月 |
| after:2026/01/01 | 从指定日期开始 |
结果展示
获取 JSON 后,向用户呈现清晰的摘要:
📥 收件箱 — 8 封新邮件(3 封未读)
⭐ [今天 09:14] ceo@empresa.com
今天下午紧急会议
📧 [今天 08:30] juan@empresa.com
回复:2026年第一季度提案
📰 [昨天 18:00] newsletter@medium.com
本周十大AI工具
...
是否需要我分析这些邮件或回复其中某封?
多账户支持
如果用户有多个 Gmail 账户:
bash
列出已配置的账户
gog auth list
读取特定账户的邮件
gog gmail search in:inbox is:unread --account otra@gmail.com --max 20 --json
切换默认账户
export GOG_ACCOUNT=otra@gmail.com
重要提示
- - 始终使用 --json 获取结构化数据
- 在自动/定时任务模式下使用 --no-input 避免交互式提示
- --max 参数限制结果数量;如需更多结果可增加该值
- Gmail 搜索结果的语法与 gmail.com 相同