# Himalaya

> A command-line interface (CLI) tool written in Rust for managing emails via IMAP, SMTP, JMAP, and Maildir backends.

Himalaya is an open-source CLI email client written in Rust, developed under the Pimalaya project umbrella. It lets users manage emails entirely from the terminal using shell commands rather than an interactive event loop, distinguishing it from TUI clients like aerc, mutt, or alpine. The project has received financial support from the NLnet Foundation and the European Commission through multiple NGI grants (2022–2026).

## What It Is

Himalaya is a stateless command-line interface for email. Instead of locking the terminal into an event loop, it exposes email operations as discrete shell commands — listing envelopes, searching messages, copying folders, downloading attachments — that compose naturally with other Unix tools. It is built on top of the Pimalaya I/O-free Rust libraries, which also back a companion TUI (`himalaya-tui`) and a Vim plugin, all sharing the same TOML configuration file.

## Protocol and Backend Support

Himalaya supports a broad range of email protocols and local storage formats:

- **Remote backends**: IMAP, SMTP, JMAP
- **Local backends**: Maildir (cr.yp.to specs), m2dir
- **Auth mechanisms**: anonymous, login, plain, oauthbearer, xoauth2, scram-sha-256 for IMAP/SMTP; basic and bearer for JMAP
- **TLS**: Rustls (ring or AWS crypto) and native-tls, selectable via Cargo features
- **Auto-discovery**: PACC (draft-ietf-mailmaint-pacc), Thunderbird Autoconfiguration, and RFC 6186 SRV DNS lookups

## Configuration and Setup Path

Running `himalaya` with no configuration file on disk launches an interactive wizard that prompts for an account name and email address, runs provider discovery, fills in IMAP/SMTP or JMAP defaults, and writes a TOML file to disk. The config is loaded from `$XDG_CONFIG_HOME/himalaya/config.toml`, `$HOME/.config/himalaya/config.toml`, or `$HOME/.himalayarc`. The same file is shared with `himalaya-tui`, so both binaries read from one source of truth. Multiple config paths can be deep-merged at runtime with `-c <PATH>`.

Installation is available via a curl installer script, `cargo install`, Arch Linux (pacman/AUR), Homebrew, Scoop, Fedora/COPR, and Nix Flakes.

## CLI Architecture and Composability

Himalaya exposes two API layers:

- **Shared API**: backend-agnostic commands (`mailboxes list`, `envelopes list`, `envelopes search`, `flags add`, `messages copy`, `attachments download`) that work across all configured backends
- **Protocol-specific APIs**: full native surface under subgroups (`himalaya imap …`, `himalaya jmap …`, `himalaya maildir …`, `himalaya smtp …`)

For richer message composition — multipart MIME, MML directives, signing, encryption — the README recommends chaining a standalone composer such as `mml` into `messages send` via process substitution. Session reuse across multiple commands is handled by pairing Himalaya with `sirup`, a companion tool that exposes a pre-authenticated IMAP/SMTP session over a Unix socket.

## Update: v1.2.0 and v2 in Development

The latest stable release is **v1.2.0**, published February 19, 2026. The repository's `master` branch documents **Himalaya v2**, which is not yet released as of the README's last update. Version 2 introduces breaking changes covered in a `MIGRATION.md` guide; notable v2 changes include removal of native keyring support (replaced by command-based secret resolution via tools like `pass` or `pimalaya/mimosa`) and removal of built-in OAuth 2.0 flows (delegated to `pimalaya/ortie` or other token brokers). The project notes that 2027 NLnet funding is in preparation, signaling continued active development.

## Features
- IMAP, SMTP, and JMAP remote backend support
- Maildir and m2dir local filesystem backend support
- Shared backend-agnostic API for mailboxes, envelopes, flags, messages, and attachments
- Protocol-specific APIs exposing full native backend surface
- TOML configuration with multi-account support
- Shared config file with himalaya-tui
- Interactive account setup wizard with auto-discovery (PACC, Thunderbird Autoconfiguration, RFC 6186 SRV)
- Multiple TLS options: Rustls (ring/AWS) and native-tls
- Auth: anonymous, login, plain, oauthbearer, xoauth2, scram-sha-256, HTTP basic/bearer
- JSON output via --flag
- Envelope search with filtering and sorting
- Session reuse via sirup Unix socket integration
- Composable with mml for rich MIME composition
- Configurable log levels and log file output
- Multi-path deep-merged configuration

## Integrations
IMAP, SMTP, JMAP, Maildir, m2dir, mml (MML composer), sirup (session reuse), ortie (OAuth 2.0 token broker), mimosa (keyring/secret management), pimconf (discovery chain), Vim (himalaya-vim plugin), Emacs (himalaya-emacs plugin), Raycast (himalaya extension), OpenClaw, dfzf

## Platforms
WINDOWS, MACOS, LINUX, API, CLI

## Pricing
Open Source

## Version
v1.2.0

## Links
- Website: https://github.com/pimalaya/himalaya
- Documentation: https://github.com/pimalaya/himalaya/blob/master/README.md
- Repository: https://github.com/pimalaya/himalaya
- EveryDev.ai: https://www.everydev.ai/tools/himalaya
