Loading...
Loading...
飞书邮箱(Mail)操作。查看邮件、发送邮件、回复、转发、管理草稿、批量获取、线程、过滤。 当用户请求"发邮件"、"看邮件"、"查邮件"、"回复邮件"、"转发邮件"、"邮件草稿"、"收件箱"、 "feishu mail"、"lark mail"、"未读邮件"时使用。
npx skill4agent add riba2534/feishu-cli feishu-cli-mail首期限制:仅支持纯文本/HTML body,暂不支持附件和 CID 内联图片。send / draft-create / draft-edit / reply / reply-all / forward
feishu-cli auth loginfeishu-cli auth check --scope "mail:user_mailbox:readonly"| 命令 | 用途 |
|---|---|
| 获取单封邮件(含 HTML 或纯文本 body) |
| 批量获取多封邮件 |
| 获取邮件线程(对话) |
| 列出/过滤邮件(folder/label/query/unread-only) |
# 查未读收件箱
feishu-cli mail triage --folder INBOX --unread-only --page-size 20
# 列出可用文件夹和标签
feishu-cli mail triage --list-folders
feishu-cli mail triage --list-labels
# 搜索邮件
feishu-cli mail triage --query "周会"
# 获取单封
feishu-cli mail message --message-id msg_xxx
feishu-cli mail message --message-id msg_xxx --format plain_text_full
# 批量获取
feishu-cli mail messages --message-ids m1,m2,m3
# 获取线程
feishu-cli mail thread --thread-id thread_xxx| 命令 | 用途 |
|---|---|
| 发送邮件(默认草稿,加 |
| 创建草稿(不发送) |
| 编辑已有草稿(全量覆盖) |
| 回复邮件(自动 Re: 前缀 + 引用块 + In-Reply-To) |
| 全部回复(包含原邮件 To 和 CC 的所有人,自动排除自己) |
| 转发邮件(自动 Fwd: 前缀 + 原文) |
# 发邮件(默认保存为草稿,安全兜底)
feishu-cli mail send --to user@example.com --subject "测试" --body "hi"
# 直接发送
feishu-cli mail send --to user@example.com --subject "测试" --body "hi" --confirm-send
# 多人、抄送、HTML
feishu-cli mail send --to a@x.com,b@x.com --cc c@x.com \
--subject "会议纪要" --body "<h2>议程</h2><p>1. ...</p>" --html --confirm-send
# 创建草稿
feishu-cli mail draft-create --to user@example.com --subject "草稿" --body "初稿"
# 编辑草稿
feishu-cli mail draft-edit --draft-id xxx --to user@example.com --subject "修订" --body "新内容"
# 回复
feishu-cli mail reply --message-id msg_xxx --body "收到,周三开会"
feishu-cli mail reply --message-id msg_xxx --body "同意" --confirm-send
# 全部回复
feishu-cli mail reply-all --message-id msg_xxx --body "+1"
# 转发
feishu-cli mail forward --message-id msg_xxx --to new@example.com --body "请关注此邮件"# 1. 查未读
feishu-cli mail triage --folder INBOX --unread-only -o json > unread.json
# 2. 逐封处理(拿 message_id → 看内容 → 回复)
feishu-cli mail message --message-id <id> -o json
feishu-cli mail reply --message-id <id> --body "已阅" --confirm-sendfeishu-cli mail send \
--to team@example.com \
--subject "周报" \
--body "$(cat weekly-report.html)" \
--html \
--confirm-send# 1. 创建草稿
DRAFT_ID=$(feishu-cli mail draft-create --to user@example.com --subject "合同" --body "初稿" -o json | jq -r .draft_id)
# 2. 审阅后修改
feishu-cli mail draft-edit --draft-id $DRAFT_ID --to user@example.com --subject "合同 v2" --body "修订后内容"
# 3. 通过 mail send 重建为真发送(draft-edit 只更新不发送)
# 或在飞书 Web 上手动发送| 命令 | 必需 scope |
|---|---|
| |
| 上述只读权限 + |
mail send--confirm-send--body<html><body><div><p><br><b><i><a <table><h1><h2><h3>--plain-text--htmlreply/reply-all> --fromGET /profileprimary_email_addressname/drafts--mailboxmereplyRe: Re:forwardFwd: Fwd:reply/reply-allsmtp_message_idreferences