imsg
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseimsg
imsg
Use to read and send iMessage/SMS via macOS Messages.app.
imsg使用 即可在macOS上通过Messages.app读取和发送iMessage/SMS。
imsgWhen 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 tool with
messagechannel:telegram - Signal messages → use Signal channel if configured
- WhatsApp messages → use WhatsApp channel if configured
- Discord messages → use tool with
messagechannel:discord - Slack messages → use skill
slack - 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消息 → 使用工具并指定
messagechannel:telegram - 发送Signal消息 → 若已配置Signal通道则使用对应通道
- 发送WhatsApp消息 → 若已配置WhatsApp通道则使用对应通道
- 发送Discord消息 → 使用工具并指定
messagechannel:discord - 发送Slack消息 → 使用skill
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 --jsonbash
imsg chats --limit 10 --jsonView History
查看消息历史
bash
undefinedbash
undefinedBy 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
undefinedimsg history --chat-id 1 --limit 20 --attachments --json
undefinedWatch for New Messages
监听新消息
bash
imsg watch --chat-id 1 --attachmentsbash
imsg watch --chat-id 1 --attachmentsSend Messages
发送消息
bash
undefinedbash
undefinedText 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
undefinedimsg send --to "+14155551212" --text "Hi" --service imessage
imsg send --to "+14155551212" --text "Hi" --service sms
undefinedService Options
服务类型选项
- — Force iMessage (requires recipient has iMessage)
--service imessage - — Force SMS (green bubble)
--service sms - — Let Messages.app decide (default)
--service auto
- — 强制使用iMessage(要求接收方支持iMessage)
--service imessage - — 强制使用SMS(绿色气泡)
--service sms - — 由Messages.app自动选择(默认值)
--service auto
Safety Rules
安全规则
- Always confirm recipient and message content before sending
- Never send to unknown numbers without explicit user approval
- Be careful with attachments — confirm file path exists
- Rate limit yourself — don't spam
- 发送消息前务必确认接收方和消息内容
- 未经用户明确许可,严禁向未知号码发送消息
- 谨慎处理附件 — 确认文件路径真实存在
- 控制发送频率 — 不要发送垃圾消息
Example Workflow
示例工作流
User: "Text mom that I'll be late"
bash
undefined用户:"Text mom that I'll be late"(给妈妈发消息说我会晚到)
bash
undefined1. 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"
undefinedimsg send --to "+1555123456" --text "I'll be late"
undefined