imsg
它能做什么
它指导 AI 智能体使用 imsg 命令,在 Mac 上通过 Messages 处理消息,包括单人和群组聊天。它适合希望智能体帮忙处理 iMessage 对话的人。
适用场景
- ✓想让智能体在你的 Mac 上找到某个 iMessage 对话的时候。
- ✓需要向特定的 iMessage 或短信聊天发送回复或表情回应的时候。
- ✓想通过 Messages 应用监控对话中的新消息的时候。
技能链接
https://github.com/openclaw/openclaw/blob/main/extensions/imessage/skills/imsg/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请找到我和 Alex 最近的一条 iMessage 对话,并回复说我会晚十分钟到。”
每周 5 个新技能,1 分钟读完。
工作原理
技能先确定准确的聊天,向你显示匹配的对象和消息。只有在你确认后才发送或执行操作,并且使用最有限的、符合需要的命令。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
imsg
Use the generic message tool first for actions that its current iMessage schema exposes. Use imsg when the task needs local Messages.app history, target discovery, watching, or an administrative/private-API capability that is not exposed by message.
Do not use this skill for Telegram, Signal, WhatsApp, Discord, Slack, or for replying inside the current OpenClaw conversation when the configured channel already routes the reply.
Agent Flow
- Resolve the conversation first.
- Choose DM, existing group, or new group.
- Prefer an available
messageaction; otherwise pick the lowest-capabilityimsgcommand that preserves the requested semantics. - Confirm any send or visible state change unless the user already gave exact recipient, content, and action.
- Execute with stable identifiers: prefer
--chat-idfor normal sends/watch/history and--chatchat GUID for bridge actions.
Never infer a recipient from a casual name alone when several chats or handles could match. Show the matched display name, handle(s), group participants, and message text/action before sending.
Host Requirements
- macOS 14+ with Messages.app signed in for send/react/bridge actions.
- Private API mode is strongly encouraged for OpenClaw iMessage. It unlocks replies, precise tapbacks, effects, polls, attachment replies, read/typing actions, and group management. Basic mode is a fallback for reads plus plain text/file send.
- Full Disk Access for the process context that runs
imsgor OpenClaw; reads fail without Messages DB access. - Automation permission for Messages.app when using public
send. - Accessibility permission for the process context that runs public
imsg react; it uses System Events UI automation. Bridgetapbackuses private API instead. - Optional Contacts permission for contact-name resolution.
- SMS sends require Text Message Forwarding from the user's iPhone to this Mac.
- Linux reads a copied
chat.dbonly; it cannot send, react, launch Messages.app, mark read, or type.
Resolve Targets
Use --json reads. Output is newline-delimited JSON; use jq -s when jq is available, or consume one object per line directly.
imsg chats --limit 25 --json | jq -s
imsg search --query "dinner" --match contains --json | jq -s
imsg history --chat-id 42 --limit 20 --attachments --json | jq -s
imsg group --chat-id 42 --json
Target rules:
- DM to a phone/email: use
imsg send --towhen the user gave an exact handle, or after a single unambiguous chat match. - Existing DM thread:
imsg send --chat-id <id>is safer than re-resolving a name. - Existing group: inspect with
imsg group --chat-id <id> --json; send with--chat-id, bridge with the chat GUID fromgroup. - New group: use
chat-createonly when the user explicitly asked to create a group or no existing group matches. - Ambiguous group names: confirm participants, not just display name.
- SMS: use
--service smsonly when requested or when iMessage fallback is not desired. SMS relay requires Text Message Forwarding.
Do not make jq a hard prerequisite for the skill; it is only a convenient formatter for examples.
Capability Choice
Use imsg standard commands when the current message schema does not cover the operation or when local history is needed:
- Read/list/search/watch:
chats,group,history,search,watch - Basic text/file send:
send - Standard tapback to most recent incoming message in a chat:
react
Use the private API bridge for the native iMessage actions OpenClaw users normally expect:
- Rich replies, text formatting, effects, subjects, multipart sends
- Native Apple Messages polls and poll votes
- Tapback by message GUID or tapback removal
- Edit, unsend, delete, notify anyways
- Read receipts, typing indicators, bridge event watch
- Group create/name/photo/member/leave/delete/mark actions
- Account, whois, nickname checks
For OpenClaw channel setup, check bridge availability early:
imsg status --json
If the host supports bridge actions but Messages is not injected yet, ask before running imsg launch. It kills and relaunches Messages.app to inject the bridge, so treat it as a visible state change:
imsg launch
imsg status --json
If SIP, library validation, private entitlement checks, or missing selectors still block the capability, explain that the requested private-API action is unavailable on this host and offer the closest non-bridge action, if one exists.
常见问题
它能在 Windows 上使用吗?
不能。发送和回应消息需要 macOS 14 或更新版本,并且 Messages 已登录。
为什么它推荐 Private API 模式?
该模式可解锁更多功能,例如回复、tapback、效果和群组管理。
它会误发给别人吗?
它的设计就是为了防止这种情况。当多个聊天可能匹配时,它不会根据随口说的名字猜测收件人。
详情
作者的原始描述
Use the imsg CLI from OpenClaw agents for iMessage/SMS DMs, groups, replies, reactions, polls, watching, and private-API actions.
repo: openclaw/openclaw
热度
- GitHub 星标
- 394k
- 排名
- #24
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
discord-user-post
394k让你的智能体通过 Discord 桌面应用,以你的身份发送你已批准的消息,并在发送前确认具体频道。
discrawl
394k让你的智能体搜索和总结本地保存的 Discord 消息档案,查看档案的新旧程度,并阅读私信。
gitcrawl
394k让你的智能体搜索已保存的 GitHub 议题和拉取请求档案,将重复内容归类,并在 GitHub 上核实它们的当前状态。
graincrawl
394k让你的智能体搜索已保存的 Granola 会议记录和转写稿,查看它们的新旧程度,并统计某段时间内的数量。