Skip to content

feat: Himalaya email integration — ZSH wrappers, fzf picker, notifications #331

@Data-Wise

Description

@Data-Wise

Summary

Integrate himalaya CLI email client into flow-cli with ADHD-friendly shell wrappers, fzf-powered email browsing, smart rendering, and desktop notifications.

Architecture: himalaya → email-oauth2-proxy (localhost) → Office 365 (OAuth2)


Proposed Features

1. Core Email Aliases

Alias Command Purpose
hm himalaya Base command
hml himalaya envelope list List inbox
hmr himalaya message read Read message
hmw himalaya message write Compose
hmf himalaya folder list List folders
hms himalaya envelope list -f 'Sent Items' Sent mail

2. Shell Functions

  • hminbox [N] — Quick inbox check (default 25)
  • hmunread — Unread count
  • hmread <ID> — Read with bat syntax highlighting + paging
  • hmhtml <ID> — Render HTML email via w3m
  • hmpick [FOLDER] — fzf interactive email picker with preview
  • hmreply <ID> — Quick reply
  • hmattach <ID> — Download attachments
  • hmfind <query> — Search and browse
  • hmdash — Dashboard (unread count + latest 10)

3. fzf Integration

  • Email picker with preview pane (hmpick)
  • Folder browser (hfolder)
  • Search with fzf preview (hsearch)
  • JSON-powered rich display mode (hpick_json)

4. Smart Rendering Pipeline

  • Auto-detect HTML vs plaintext content
  • HTML → w3m rendering
  • Markdown → glow rendering
  • Fallback → bat syntax highlighting
  • Combined in hpage() smart pager function

5. Notification Integration

  • himalaya envelope watch with built-in IMAP IDLE hooks
  • terminal-notifier poll-based fallback (LaunchAgent)
  • Optional: Mirador (Pimalaya ecosystem watcher)

6. Config Display Enhancements

  • Color theme (Tokyo Night inspired): cyan subjects, blue senders, magenta flags
  • UTF8 table preset for box-drawing characters
  • Friendlier datetime format (%b %d %H:%M)
  • Custom flag characters (+ unread, ! flagged, @ attachment)

Dependencies

Tool Install Required?
himalaya cargo install himalaya Yes
w3m brew install w3m Recommended (HTML rendering)
bat brew install bat Recommended (paging)
glow brew install glow Optional (Markdown rendering)
fzf brew install fzf Recommended (interactive picker)
jq brew install jq Recommended (JSON processing)
terminal-notifier brew install terminal-notifier Optional (notifications)
urlscan brew install urlscan Optional (URL extraction)

Implementation Plan

Quick Wins

  1. Add core aliases to zsh/aliases/
  2. Add color/display config to himalaya config.toml
  3. Install w3m + bat

Medium Effort

  1. Build fzf email picker functions in zsh/functions/
  2. Set up envelope watch with notification hooks
  3. Create smart rendering pipeline (hpage)

Long-term

  1. Neverest + Notmuch for offline full-text search
  2. LaunchAgent for poll-based notifications
  3. Integration with dash command (email section in master dashboard)
  4. Integration with work command (email context per project)

Full Research Document

Complete research with code examples, config references, community discussion, and tool comparisons:

📎 DISPLAY-ENHANCEMENTS.md

Covers: plugin ecosystem, HTML rendering, pager integration, fzf integration, Notmuch backend, MML/MIME handling, wrapper scripts, config display options, TUI frontends, email notifications, neomutt/aerc comparison, and community discussions.


Context

  • Email setup: UNM LoboMail (Microsoft 365) via email-oauth2-proxy (device code flow)
  • Proxy runs as launchd service (com.emailproxy)
  • Config: ~/.config/himalaya/config.toml
  • Tutorial: ~/.config/himalaya/TUTORIAL.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions