imsg
Skill này làm gì
Skill hướng dẫn một agent AI dùng lệnh imsg để làm việc với Tin nhắn trên máy Mac, gồm cả trò chuyện cá nhân và nhóm. Nó dành cho những ai muốn agent giúp với các cuộc trò chuyện iMessage của mình.
Khi nào nên dùng
- ✓Khi bạn muốn agent tìm một cuộc trò chuyện iMessage trên máy Mac.
- ✓Khi bạn cần gửi trả lời hoặc biểu cảm vào một cuộc trò chuyện iMessage hoặc SMS cụ thể.
- ✓Khi bạn muốn theo dõi một cuộc trò chuyện để xem tin nhắn mới qua app Tin nhắn.
Liên kết skill
https://github.com/openclaw/openclaw/blob/main/extensions/imessage/skills/imsg/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tìm cuộc trò chuyện iMessage gần nhất của tôi với Alex và gửi trả lời rằng tôi sẽ đến muộn mười phút.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill trước hết xác định đúng cuộc trò chuyện và hiển thị cho bạn kết quả khớp cùng tin nhắn. Skill chỉ gửi hoặc thực hiện hành động sau khi bạn xác nhận, bằng lệnh hạn chế nhất phù hợp.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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.
Câu hỏi thường gặp
Skill có chạy trên Windows không?
Không. Skill cần macOS 14 trở lên, và Tin nhắn phải đã đăng nhập để gửi và thả biểu cảm.
Tại sao skill khuyên dùng chế độ Private API?
Chế độ đó mở khóa thêm tính năng, như trả lời, tapback, hiệu ứng và quản lý nhóm.
Agent có thể nhắn nhầm người không?
Skill được thiết kế để ngăn điều đó. Nó sẽ không đoán người nhận từ một cái tên thân mật khi nhiều cuộc trò chuyện có thể khớp.
Chi tiết
Mô tả gốc của tác giả
Use the imsg CLI from OpenClaw agents for iMessage/SMS DMs, groups, replies, reactions, polls, watching, and private-API actions.
repo: openclaw/openclaw
Độ phổ biến
- Sao GitHub
- 394k
- Vị trí xếp hạng
- #24
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
discord-user-post
394kCho phép agent của bạn đăng tin nhắn đã duyệt lên Discord dưới tên bạn qua app Discord trên máy tính, sau khi xác nhận đúng kênh.
discrawl
394kCho phép agent của bạn tìm kiếm và tóm tắt kho lưu trữ tin nhắn Discord trên máy, kiểm tra độ mới của dữ liệu và đọc tin nhắn trực tiếp.
gitcrawl
394kCho phép agent của bạn tìm trong kho lưu trữ issue và pull request GitHub, gom các mục trùng lặp và kiểm tra trạng thái hiện tại trên GitHub.
graincrawl
394kCho phép agent của bạn tìm trong ghi chú cuộc họp và bản chép lời Granola đã lưu, kiểm tra độ mới và đếm số cuộc họp trong một khoảng thời gian.
Skill tương tự
to-questionnaire
310kBiến một câu hỏi bạn không tự trả lời được thành bảng câu hỏi bằng văn bản để người khác điền, qua email hoặc trong cuộc họp.
email-ops
280kGiúp agent quản lý email, sắp xếp hộp thư và kiểm tra việc gửi thư. Đảm bảo các thư quan trọng được gửi đi và theo dõi được.
messages-ops
280kGiúp agent đọc tin nhắn và mã xác minh. Hữu ích để kiểm tra cuộc trò chuyện trước khi trả lời hoặc chứng minh đã xem tin nhắn nào.