跳到主要內容

iMessage

通過 macOS 上的 imsg CLI 發送和接收 iMessage/SMS。

技能元數據

來源捆綁(默認安裝)
路徑skills/apple/imessage
版本1.0.0
作者Hermes Agent
許可證MIT
平臺macos
標籤iMessage, SMS, messaging, macOS, Apple

參考:完整 SKILL.md

信息

以下是 Hermes 在觸發此技能時加載的完整技能定義。這是技能激活時代理所看到的指令。

iMessage

使用 imsg 通過 macOS 的 Messages.app 讀取和發送 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. 發送前務必確認收件人和消息內容
  2. 未經用戶明確批准,切勿向陌生號碼發送消息
  3. 附加文件前驗證文件路徑是否存在
  4. 不要發送垃圾消息 — 自我限制頻率

示例工作流

用戶:“給我媽發短信說我晚點到”

# 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"