matcha

repository·master·Indexed 21 days ago

https://github.com/floatpane/matcha

A modern, feature-rich email client for the terminal built with Go and the Bubble Tea TUI framework. It supports multiple accounts, an extensible plugin system, and various email protocols including IMAP, JMAP, and POP3 via a unified Provider interface. The client includes performance-critical C components (clib) for HTML parsing, image processing, and Markdown conversion, as well as secure data management featuring optional AES-256-GCM at-rest encryption and OAuth2 authentication for Gmail and Outlook.

Tokens
39.7K
Snippets
116
Records
219
Agent score
76%

What's inside matcha

  1. Overview of the Matcha documentation site

    master
    The documentation for Matcha is a static website built using Docusaurus. It serves as the central hub for user-facing guides, feature documentation, and technical references. The site is organized into high-level guides (Installation, Usage, Configuration) and detailed feature-specific documentation.
  2. Overview of the view package

    master

    The view package is responsible for rendering email content for terminal display. It transforms HTML email bodies into styled terminal text. Key features include:

    • Hyperlink Support: Uses OSC 8 escape sequences for clickable links, with fallbacks for terminals that do not support them.
    • Inline Image Rendering: Supports multiple terminal graphics protocols including the Kitty Graphics Protocol (compatible with Kitty, Ghostty, WezTerm, Wayst, Konsole) and the iTerm2 Image Protocol (compatible with iTerm2, Warp).
    • Quoted Reply Formatting: Automatically detects and styles quoted reply sections (e.g., lines prefixed with > or patterns like On DATE, EMAIL wrote:) using styled quote boxes.
    • Markdown Support: Converts Markdown content to HTML using Goldmark before the rendering process begins.
  3. Overview of the Matcha User Interface

    master

    Matcha provides a modern Terminal User Interface (TUI) designed for efficiency and aesthetics. The interface is built using the Bubble Tea framework and includes the following core capabilities:

    • Vim-like Keybindings: Supports efficient keyboard navigation using standard keys like j/k (vertical movement) and h/l (horizontal movement).
    • Responsive Design: The UI automatically adapts to your terminal window size.
    • Tabbed Interface: Allows for switching between different accounts using tab navigation.
    • Focus Management: Provides clear visual indicators to show which elements are currently focused.
    • Contextual Help: Each screen includes built-in help text that displays available commands for the current view.
    • Styled Elements: Uses color-coded interface elements to improve readability.
  4. Overview of the sender package

    master
    The sender package is the SMTP client layer for Matcha. It is responsible for email composition and delivery. It handles the construction of multipart MIME messages (including plain text, HTML, inline images, and file attachments) and manages the transmission via an SMTP server.
  5. Overview of Contact Management features

    master

    Matcha provides several automated contact management capabilities:

    • Automatic Contact Saving: Email addresses are automatically captured from both incoming and outgoing emails.
    • Smart Search: Supports fuzzy searching through your contact database during email composition.
    • Quick Autocomplete: Provides real-time contact suggestions as you type in the "To" field.
    • Persistent Storage: All contacts are stored locally to ensure availability during offline access.
  6. Overview of the fetcher package

    master
    The fetcher package serves as the IMAP client layer for Matcha. It is responsible for all email retrieval operations, including connecting to mail servers via TLS/STARTTLS, fetching headers and bodies, and managing attachments. It also provides mailbox management capabilities such as deleting, archiving, and moving emails between folders.
  7. Overview of clib components

    master

    The clib directory contains C implementations of performance-critical operations in Matcha, integrated via cgo. These components are used to achieve higher speeds and lower memory usage for specific tasks compared to pure Go implementations.

    Key components include:

    • base64wrap: MIME-compliant base64 line-wrapping (RFC 2045) at 76 characters with \r\n separators.
    • imgconv: Image decoding and PNG re-encoding using stb_image.
    • htmlconv: A single-pass HTML-to-structured-elements parser.
    • markdown: Markdown-to-HTML conversion using md4c (supports GitHub-flavored features).
  8. Explore Matcha core features

    master

    Matcha provides a comprehensive suite of features for terminal-based email management:

    • Email Operations: Read, reply, delete, and archive emails.
    • Composition: Write emails using Markdown with rich formatting support.
    • Account & Contact Management: Manage multiple email accounts and organized contact lists.
    • Drafts: Save and resume unfinished email compositions.
    • User Interface: A responsive, tabbed interface featuring color-coding and focus management.
    • Advanced Capabilities: Automatic updates, smart image rendering, and performance optimizations.
    • Command Line Interface (CLI): Send emails and manage accounts directly from the terminal.
    • AI Integration: Support for AI agents to send emails and an AI Rewrite feature to refine drafts using AI models.
    • Extensibility: Extend functionality using Lua plugins.
  9. Manage unfinished emails with Draft Management

    master

    Matcha provides a suite of features to handle unfinished emails through a dedicated Draft Management system. This allows you to prevent data loss and organize your writing process.

    Key capabilities include:

    • Automatic Draft Saving: Drafts are automatically captured when you exit the email composer.
    • Draft Library: A centralized location to view and manage all saved drafts.
    • Resume Editing: The ability to reopen and continue working on any existing draft.
    • Draft Cleanup: Tools to delete drafts that are no longer required.
    • Time Tracking: Metadata showing when each draft was last modified.
    • Search Drafts: Functionality to filter your draft library by subject or recipient.
  10. Use email composition features in Matcha

    master

    The Matcha email composer includes several productivity features:

    • Markdown Support: Automatic conversion from Markdown to HTML.
    • Inline Images: Use ![alt](path/to/image.png) syntax to embed images.
    • File Attachments: Use the integrated file picker to attach files.
    • Contact Autocomplete: Get smart suggestions based on your contact history.
    • Auto-save Drafts: Work is automatically saved to prevent data loss.
    • Multi-Account Sending: Select the desired sending account via a picker.
    • Reply Threading: Uses In-Reply-To and References headers for proper threading.
    • Rich Formatting: Supports sending both plain text and HTML versions of the email.
  11. Manage emails in Matcha

    master

    Matcha allows you to manage your email workflow directly from the terminal. Key capabilities include:

    • Inbox & Sent Mail: View and manage messages from both your inbox and sent folders.
    • Multi-Account Support: Use a tabbed interface to switch between multiple email accounts.
    • Performance: Uses smart caching for instant inbox display with background refreshes, and supports infinite scroll to load more emails as you navigate.
    • Search & Filter: Use built-in filtering to locate emails by subject, sender, or content.
    • Real-time Refresh: Manually trigger an inbox refresh using a single keypress.
  12. View rich email content in Matcha

    master

    Matcha provides advanced rendering for different email formats to ensure readability in the terminal:

    • HTML: Renders HTML emails with proper formatting.
    • Markdown: Supports Markdown for plain-text emails.
    • Styling: Provides styled headers and body text.
    • Encoding: Handles quoted-printable encoding automatically.