Skip to content

guiyumin/maily

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

448 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maily

A fast, keyboard-driven terminal email client with calendar integration.

Features

  • Multi-account support - Gmail, Yahoo, and custom IMAP providers
  • Fast startup - Local caching with background sync server
  • Keyboard-driven interface - Vim-inspired navigation, command palette
  • Email operations - Compose, reply, delete, search, folder/label navigation
  • Calendar integration - macOS EventKit with natural language event creation
  • AI summarization - Email summaries via Claude, Codex, Gemini, Ollama, or BYOK
  • Today view - Combined view of emails and calendar events
  • Bulk actions - Multi-select in search results for batch operations
  • Self-update - Built-in update mechanism

Platforms

  • macOS - Full features including calendar integration
  • Linux - All features except calendar (no EventKit)

Installation

Homebrew (macOS/Linux)

brew install guiyumin/tap/maily

From Source

git clone https://github.com/guiyumin/maily.git
cd maily
make build
./build/maily

Self-Update

maily update

Quick Start

  1. Add your email account:
maily login gmail      # For Gmail
maily login yahoo      # For Yahoo
maily login qq         # For qq mail
  1. Start the TUI:
maily

The background server starts automatically when you open maily.

Key Bindings

See docs/keybindings.md for the full list of key bindings.

Commands

# Email
maily                  # Start TUI
maily login gmail      # Add Gmail account
maily login yahoo      # Add Yahoo account
maily login qq         # Add qq mail account
maily logout           # Remove account
maily accounts         # List accounts
maily sync             # Manual full sync

# Search (-a required if multiple accounts)
maily search -a me@gmail.com -q "from:temu"    # Interactive TUI search
maily search -q "is:unread" --count            # Count matching emails
maily search -q "from:amazon" --format=json --limit=50
maily search -q "has:attachment" --format=table

# Calendar (macOS)
maily calendar         # Calendar TUI
maily c                # Short alias
maily c list           # List available calendars
maily c add "..."      # Create event with natural language

# Today View
maily today            # Combined email + calendar view
maily t                # Short alias

# Server
maily server status    # Check server status
maily server stop      # Stop the server
maily server start     # Start server manually

# Configuration
maily config           # Interactive config TUI

# Maintenance
maily update           # Update to latest version
maily version          # Show version info

Configuration

Configuration is stored in ~/.config/maily/:

  • accounts.yml - Email accounts and credentials
  • config.yml - Application settings
  • maily.db - Email cache (SQLite)
  • server.pid - Background server PID

Settings

# ~/.config/maily/config.yml
max_emails: 50 # Emails to load per page
default_label: INBOX # Default folder
theme: default # UI theme

# AI accounts (OpenAI-compatible API)
ai_accounts:
  - name: openai
    base_url: https://api.openai.com/v1
    api_key: sk-...
    model: gpt-4o-mini

Gmail Setup

  1. Enable 2-Factor Authentication on your Google account
  2. Generate an App Password: Google Account > Security > App Passwords
  3. Use the 16-character App Password when running maily login gmail

Yahoo Setup

  1. Enable 2-Factor Authentication on your Yahoo account
  2. Generate an App Password: Account Security > Generate app password
  3. Use the App Password when running maily login yahoo

See docs/features/yahoo-mail.md for detailed instructions.

AI Integration

Maily supports AI-powered features through multiple providers:

  • CLI tools: Claude, Codex, Gemini, Ollama (auto-detected)
  • BYOK (Bring Your Own Key): Any OpenAI-compatible API (configure in config.yml)

Features:

  • Email summarization (s key in read view)
  • Natural language calendar event creation (n key in calendar)
  • Event extraction from emails

Architecture

  • Built with Go and Bubbletea (Elm-architecture TUI framework)
  • Uses go-imap/v2 for IMAP and SMTP
  • Local cache for fast startup, background server for sync (30-min interval)
  • No optimistic UI - server operations wait for confirmation
  • macOS calendar via EventKit (CGO)

License

Apache 2.0