关于 imessage
此技能使用 `imsg` 命令行工具,通过 macOS 的 Messages.app 读取和发送 iMessage 或 SMS。它涵盖查找聊天、查看历史记录、处理附件和发送消息,并要求确认收件人及内容。
主要功能
- 01以 JSON 列出近期聊天
- 02读取对话历史记录
- 03查看附件详情
- 04发送文本和文件附件
- 05监视聊天中的新消息
- 06选择 iMessage、SMS 或自动服务
适用场景
- 01发送前查找联系人的聊天
- 02查看近期对话记录
- 03发送带附件的消息
- 04监视聊天中的新消息
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ nousresearch/ hermes-agent --skill imessage安装后在 Claude Code 中输入/imessage确认已加载。
详细介绍
iMessage
通过 macOS Messages.app 使用 imsg 读取和发送 iMessage/SMS。
前提条件
- macOS,且已在 Messages.app 中登录
- 安装:
brew install steipete/tap/imsg - 为终端授予完全磁盘访问权限(系统设置 → 隐私与安全性 → 完全磁盘访问权限)
- 根据提示授予 Messages.app 自动化权限
使用时机
- 用户要求发送 iMessage 或短信
- 读取 iMessage 聊天记录
- 查看最近的 Messages.app 聊天
- 向电话号码或 Apple ID 发送消息
不要使用的场景
- Telegram/Discord/Slack/WhatsApp 消息 → 使用相应的网关渠道
- 群聊管理(添加/移除成员)→ 不支持
- 批量/群发消息 → 始终先向用户确认
快速参考
列出聊天
imsg chats --limit 10 --json
查看历史记录
# By chat ID
imsg history --chat-id 1 --limit 20 --json
# With attachments info
imsg history --chat-id 1 --limit 20 --attachments --json
发送消息
# Text only
imsg send --to "+14155551212" --text "Hello!"
# With attachment
imsg send --to "+14155551212" --text "Check this out" --file /path/to/image.jpg
# Force iMessage or SMS
imsg send --to "+14155551212" --text "Hi" --service imessage
imsg send --to "+14155551212" --text "Hi" --service sms
监控新消息
imsg watch --chat-id 1 --attachments
服务选项
--service imessage— 强制使用 iMessage(接收方必须支持 iMessage)--service sms— 强制使用 SMS(绿色气泡)--service auto— 由 Messages.app 自行决定(默认)
规则
- 发送前务必确认接收方和消息内容
- 未经用户明确批准,绝不向未知号码发送消息
- 添加附件前,验证文件路径是否存在
- 不要发送垃圾消息——自行限制发送频率
工作流示例
用户:“告诉妈妈我会迟到”
# 1. Find mom's chat
imsg chats --limit 20 --json | jq '.[] | select(.displayName | contains("Mom"))'
# 2. Confirm with user: "Found Mom at +1555123456. Send 'I'll be late' via iMessage?"
# 3. Send after confirmation
imsg send --to "+1555123456" --text "I'll be late"
评论
支持 Markdown