name: himalaya
description: “通过IMAP/SMTP管理邮件的CLI工具。使用himalaya可以在终端中列出、阅读、撰写、回复、转发、搜索和组织邮件。支持多账户和MML(MIME元语言)邮件撰写。”
homepage: https://github.com/pimalaya/himalaya
metadata:
{
“openclaw”:
{
“emoji”: “📧”,
“requires”: { “bins”: [“himalaya”] },
“install”:
[
{
“id”: “brew”,
“kind”: “brew”,
“formula”: “himalaya”,
“bins”: [“himalaya”],
“label”: “安装Himalaya (brew)”,
},
],
},
}
Himalaya 邮件命令行工具
Himalaya 是一个命令行邮件客户端,允许您使用 IMAP、SMTP、Notmuch 或 Sendmail 后端从终端管理邮件。
参考文档
references/configuration.md(配置文件设置 + IMAP/SMTP 认证)references/message-composition.md(用于撰写邮件的 MML 语法)
前提条件
- 已安装 Himalaya CLI(使用
himalaya --version验证) - 配置文件位于
~/.config/himalaya/config.toml - 已配置 IMAP/SMTP 凭据(密码安全存储)
配置设置
运行交互式向导设置账户:
himalaya account configure
或手动创建 ~/.config/himalaya/config.toml:
[accounts.personal]
email = "you@example.com"
display-name = "您的姓名"
default = true
backend.type = "imap"
backend.host = "imap.example.com"
backend.port = 993
backend.encryption.type = "tls"
backend.login = "you@example.com"
backend.auth.type = "password"
backend.auth.cmd = "pass show email/imap" # 或使用密钥环
message.send.backend.type = "smtp"
message.send.backend.host = "smtp.example.com"
message.send.backend.port = 587
message.send.backend.encryption.type = "start-tls"
message.send.backend.login = "you@example.com"
message.send.backend.auth.type = "password"
message.send.backend.auth.cmd = "pass show email/smtp"
常用操作
列出文件夹
himalaya folder list
列出邮件
列出收件箱(默认)中的邮件:
himalaya envelope list
列出特定文件夹中的邮件:
himalaya envelope list --folder "已发送"
分页列出:
himalaya envelope list --page 1 --page-size 20
搜索邮件
himalaya envelope list from john@example.com subject meeting
阅读邮件
按 ID 阅读邮件(显示纯文本):
himalaya message read 42
导出原始 MIME:
himalaya message export 42 --full
回复邮件
交互式回复(打开 $EDITOR):
himalaya message reply 42
回复全部:
himalaya message reply 42 --all
转发邮件
himalaya message forward 42
撰写新邮件
交互式撰写(打开 $EDITOR):
himalaya message write
使用模板直接发送:
cat << 'EOF' | himalaya template send
From: you@example.com
To: recipient@example.com
Subject: 测试邮件
来自 Himalaya 的问候!
EOF
或使用标题标志:
himalaya message write -H "To:recipient@example.com" -H "Subject:测试" "邮件正文在此"
移动/复制邮件
移动到文件夹:
himalaya message move 42 "归档"
复制到文件夹:
himalaya message copy 42 "重要"
删除邮件
himalaya message delete 42
管理标记
添加标记:
himalaya flag add 42 --flag seen
移除标记:
himalaya flag remove 42 --flag seen
多账户管理
列出账户:
himalaya account list
使用特定账户:
himalaya --account work envelope list
附件处理
保存邮件附件:
himalaya attachment download 42
保存到指定目录:
himalaya attachment download 42 --dir ~/Downloads
输出格式
大多数命令支持 --output 用于结构化输出:
himalaya envelope list --output json
himalaya envelope list --output plain
调试
启用调试日志:
RUST_LOG=debug himalaya envelope list
完整跟踪与回溯:
RUST_LOG=trace RUST_BACKTRACE=1 himalaya envelope list
提示
- 使用
himalaya --help或himalaya <command> --help查看详细用法。 - 邮件 ID 相对于当前文件夹;更改文件夹后请重新列出。
- 要撰写带附件的富文本邮件,请使用 MML 语法(参见
references/message-composition.md)。 - 使用
pass、系统密钥环或输出密码的命令安全存储密码。