Gmailtail
lastmod 2025-07-05created 2025-07-051 edits
Open-source CLI tool for real-time Gmail monitoring and automation
About
- A command-line tool that watches Gmail messages in real time and outputs them in various formats such as JSON
- Designed for automation, monitoring, and integration with external systems, so it integrates easily with code or scripts
- Includes core features needed for real work: real-time tail mode, flexible filters, complex YAML-based configuration, various output formats, etc.
- Various data extraction, processing, and notifications possible just by combining pipes, without code changes (e.g., jq/notify/grep)
Key features
- Real-time monitoring: continuously watch for new mail with the --tail option
- Flexible filtering: supports various conditions such as sender, subject, label, attachment, and date (full support for Gmail search queries)
- Checkpoint/resume: saves the last position, recovers after failures
- Various output formats: JSON, JSON Lines, Compact, custom field selection
- YAML configuration file: manage complex environments without code changes
- OAuth2/service account authentication: supports personal, server, and automation environments
- Pipeline usability: combine with tools such as jq, automate various post-processing
Use cases
- Watch new mail in real time and filter only specific conditions
- Fine-grained settings such as watching by attachment presence, specific keywords, or label
- Output as JSON Lines, then automate post-processing with jq, notifications, saving to files, generating statistics, etc.
- Watch GitHub/build/notification mail in real time and integrate with CI/CD
- Use in data analysis pipelines such as bulk mail analysis, statistics, and backups