imessage
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseiMessage
iMessage
Use to read and send iMessage/SMS via macOS Messages.app.
imsg使用通过macOS Messages.app读取和发送iMessage/SMS消息。
imsgPrerequisites
前提条件
- macOS with Messages.app signed in
- Install:
brew install steipete/tap/imsg - Grant Full Disk Access for terminal (System Settings → Privacy → Full Disk Access)
- Grant Automation permission for Messages.app when prompted
- 已登录Messages.app的macOS系统
- 安装命令:
brew install steipete/tap/imsg - 为终端授予完全磁盘访问权限(系统设置 → 隐私与安全性 → 完全磁盘访问权限)
- 出现提示时,为Messages.app授予自动化权限
When to Use
使用场景
- User asks to send an iMessage or text message
- Reading iMessage conversation history
- Checking recent Messages.app chats
- Sending to phone numbers or Apple IDs
- 用户要求发送iMessage或短信
- 读取iMessage对话历史
- 查看Messages.app的近期聊天记录
- 向电话号码或Apple ID发送消息
When NOT to Use
不适用场景
- Telegram/Discord/Slack/WhatsApp messages → use the appropriate gateway channel
- Group chat management (adding/removing members) → not supported
- Bulk/mass messaging → always confirm with user first
- Telegram/Discord/Slack/WhatsApp消息 → 使用对应的网关渠道
- 群聊管理(添加/移除成员)→ 不支持此功能
- 批量群发消息 → 必须先获得用户确认
Quick Reference
快速参考
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
undefinedSend 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
Force iMessage or SMS
强制使用iMessage或SMS
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
undefinedWatch for New Messages
监听新消息
bash
imsg watch --chat-id 1 --attachmentsbash
imsg watch --chat-id 1 --attachmentsService 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
Rules
规则
- Always confirm recipient and message content before sending
- Never send to unknown numbers without explicit user approval
- Verify file paths exist before attaching
- Don't spam — rate-limit yourself
- 发送前务必确认收件人和消息内容
- 未经用户明确许可,绝不向未知号码发送消息
- 发送前验证附件文件路径是否存在
- 不要发送垃圾消息 — 控制发送频率
Example Workflow
示例流程
User: "Text mom that I'll be late"
bash
undefined用户:"发短信告诉妈妈我会晚点到"
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: "Found Mom at +1555123456. Send 'I'll be late' via iMessage?"
2. 向用户确认:"找到妈妈的号码+1555123456。是否通过iMessage发送'我会晚点到'?"
3. Send after confirmation
3. 获得确认后发送
imsg send --to "+1555123456" --text "I'll be late"
undefinedimsg send --to "+1555123456" --text "I'll be late"
undefined