imsg

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

imsg

imsg

Use
imsg
to read and send iMessage/SMS via macOS Messages.app.
使用
imsg
通过macOS Messages.app读取和发送iMessage/SMS消息。

When to Use

适用场景

USE this skill when:
  • User explicitly asks to send iMessage or SMS
  • Reading iMessage conversation history
  • Checking recent Messages.app chats
  • Sending to phone numbers or Apple IDs
在以下情况使用本技能:
  • 用户明确要求发送iMessage或SMS消息
  • 查看iMessage聊天历史记录
  • 查看Messages.app的近期聊天会话
  • 向电话号码或Apple ID发送消息

When NOT to Use

不适用场景

DON'T use this skill when:
  • Telegram messages → use
    message
    tool with
    channel:telegram
  • Signal messages → use Signal channel if configured
  • WhatsApp messages → use WhatsApp channel if configured
  • Discord messages → use
    message
    tool with
    channel:discord
  • Slack messages → use
    slack
    skill
  • Group chat management (adding/removing members) → not supported
  • Bulk/mass messaging → always confirm with user first
  • Replying in current conversation → just reply normally (Clawdbot routes automatically)
在以下情况请勿使用本技能:
  • Telegram消息 → 使用
    message
    工具并指定
    channel:telegram
  • Signal消息 → 若已配置则使用Signal渠道
  • WhatsApp消息 → 若已配置则使用WhatsApp渠道
  • Discord消息 → 使用
    message
    工具并指定
    channel:discord
  • Slack消息 → 使用
    slack
    技能
  • 群聊管理(添加/移除成员)→ 暂不支持
  • 批量群发消息 → 务必先征得用户确认
  • 在当前会话中回复 → 直接正常回复即可(Clawdbot会自动路由)

Requirements

要求

  • macOS with Messages.app signed in
  • Full Disk Access for terminal
  • Automation permission for Messages.app (for sending)
  • 已登录Messages.app的macOS系统
  • 终端需拥有完全磁盘访问权限
  • Messages.app需获得自动化权限(用于发送消息)

Common Commands

常用命令

List Chats

列出聊天会话

bash
imsg chats --limit 10 --json
bash
imsg chats --limit 10 --json

View History

查看聊天记录

bash
undefined
bash
undefined

By chat ID

通过聊天ID查看

imsg history --chat-id 1 --limit 20 --json
imsg history --chat-id 1 --limit 20 --json

With attachments info

包含附件信息

imsg history --chat-id 1 --limit 20 --attachments --json
undefined
imsg history --chat-id 1 --limit 20 --attachments --json
undefined

Watch for New Messages

监听新消息

bash
imsg watch --chat-id 1 --attachments
bash
imsg watch --chat-id 1 --attachments

Send Messages

发送消息

bash
undefined
bash
undefined

Text only

仅发送文本

imsg send --to "+14155551212" --text "Hello!"
imsg send --to "+14155551212" --text "Hello!"

With attachment

附带附件

imsg send --to "+14155551212" --text "Check this out" --file /path/to/image.jpg
imsg send --to "+14155551212" --text "Check this out" --file /path/to/image.jpg

Specify service

指定服务类型

imsg send --to "+14155551212" --text "Hi" --service imessage imsg send --to "+14155551212" --text "Hi" --service sms
undefined
imsg send --to "+14155551212" --text "Hi" --service imessage imsg send --to "+14155551212" --text "Hi" --service sms
undefined

Service Options

服务选项

  • --service imessage
    — Force iMessage (requires recipient has iMessage)
  • --service sms
    — Force SMS (green bubble)
  • --service auto
    — Let Messages.app decide (default)
  • --service imessage
    — 强制使用iMessage(要求收件人已开通iMessage)
  • --service sms
    — 强制使用SMS(绿色气泡消息)
  • --service auto
    — 由Messages.app自动选择(默认选项)

Safety Rules

安全规则

  1. Always confirm recipient and message content before sending
  2. Never send to unknown numbers without explicit user approval
  3. Be careful with attachments — confirm file path exists
  4. Rate limit yourself — don't spam
  1. 发送前务必确认收件人和消息内容
  2. 未经用户明确许可,切勿向未知号码发送消息
  3. 处理附件时需谨慎 — 确认文件路径存在
  4. 限制发送频率 — 请勿发送垃圾消息

Example Workflow

示例流程

User: "Text mom that I'll be late"
bash
undefined
用户:"给妈妈发短信说我会晚点到"
bash
undefined

1. Find mom's chat

1. 查找妈妈的聊天会话

imsg chats --limit 20 --json | jq '.[] | select(.displayName | contains("Mom"))'
imsg chats --limit 20 --json | jq '.[] | select(.displayName | contains("Mom"))'

2. Confirm with user

2. 向用户确认

"Found Mom at +1555123456. Send 'I'll be late' via iMessage?"

"已找到妈妈的号码+1555123456。是否通过iMessage发送‘我会晚点到’?"

3. Send after confirmation

3. 获得确认后发送

imsg send --to "+1555123456" --text "I'll be late"
undefined
imsg send --to "+1555123456" --text "I'll be late"
undefined