名称: clippy
描述: Microsoft 365 / Outlook 命令行工具,用于管理日历和邮件。适用于管理 Outlook 日历(查看、创建、更新、删除事件,查找会议时间,回复邀请)、发送/读取邮件或在组织内搜索人员/会议室。
元数据: {"clawdbot":{"requires":{"bins":["clippy"]}}}
源码:https://github.com/foeken/clippy
通过浏览器自动化(Playwright)操作 M365 网页界面,而非使用 Graph API。无需注册 Azure AD 应用,只需通过浏览器登录即可。
git clone https://github.com/foeken/clippy.git
cd clippy && bun install
bun run src/cli.ts --help
或全局链接:bun link
# 交互式登录(打开浏览器,建立会话)
clippy login --interactive
# 检查认证状态
clippy whoami
保持浏览器会话活跃,防止令牌过期:
# 启动保活(保持浏览器打开,每 10 分钟刷新一次)
clippy keepalive --interval 10
如需持久运行,可设置为 launchd 服务(macOS)或 systemd 服务(Linux)。
健康监控: 保活服务每次成功刷新时,会写入 ~/.config/clippy/keepalive-health.txt 文件。检查该文件是否过时(>15 分钟)以检测故障。
# 今日事件
clippy calendar
# 指定日期
clippy calendar --day tomorrow
clippy calendar --day monday
clippy calendar --day 2024-02-15
# 周视图
clippy calendar --week
# 包含详细信息(描述、参会者)
clippy calendar --details
clippy create-event "标题" 09:00 10:00
# 完整选项
clippy create-event "会议" 14:00 15:00 \
--day tomorrow \
--description "会议记录" \
--attendees "alice@company.com,bob@company.com" \
--teams \
--find-room
# 重复事件
clippy create-event "站会" 09:00 09:15 --repeat daily
clippy create-event "同步会" 14:00 15:00 --repeat weekly --days mon,wed,fri
clippy update-event 1 --title "新标题"
clippy update-event 1 --start 10:00 --end 11:00
clippy delete-event 1
clippy delete-event 1 --message "需要重新安排"
clippy respond # 列出待处理邀请
clippy respond accept --id <事件ID>
clippy respond decline --id <事件ID> --message "时间冲突"
clippy respond tentative --id <事件ID>
clippy findtime
clippy findtime --attendees "alice@company.com,bob@company.com"
clippy findtime --duration 60 --days 5
# 收件箱
clippy mail
clippy mail --unread
clippy mail -n 20
clippy mail --search "发票"
# 其他文件夹
clippy mail sent
clippy mail drafts
clippy mail archive
# 阅读邮件
clippy mail -r <编号>
# 下载附件
clippy mail -d <编号> -o ~/Downloads
clippy send \
--to "recipient@example.com" \
--subject "主题" \
--body "邮件正文"
# 包含抄送、附件、Markdown
clippy send \
--to "alice@example.com" \
--cc "manager@example.com" \
--subject "报告" \
--body "**见附件**" \
--markdown \
--attach "report.pdf"
clippy mail --reply <编号> --message "谢谢!"
clippy mail --reply-all <编号> --message "收到"
clippy mail --forward <编号> --to-addr "colleague@example.com"
clippy mail --mark-read <编号>
clippy mail --flag <编号>
clippy mail --move <编号> --to archive
clippy find "john" # 人员
clippy find "conference" --rooms # 会议室
clippy calendar --json
clippy mail --json
可覆盖配置文件目录:
export CLIPPY_PROFILE_DIR=~/.config/clippy/my-profile