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
适合使用该skill的场景:
  • 用户明确要求发送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)
不适合使用该skill的场景:
  • 发送Telegram消息 → 使用
    message
    工具并指定
    channel:telegram
  • 发送Signal消息 → 若已配置Signal通道则使用对应通道
  • 发送WhatsApp消息 → 若已配置WhatsApp通道则使用对应通道
  • 发送Discord消息 → 使用
    message
    工具并指定
    channel:discord
  • 发送Slack消息 → 使用
    slack
    skill
  • 群聊管理(添加/移除成员)→ 暂不支持
  • 批量/群发消息 → 必须先征得用户确认
  • 在当前对话中回复 → 直接正常回复即可(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
用户:"Text mom that I'll be late"(给妈妈发消息说我会晚到)
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发送内容为'I'll be late'的消息?"

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