imessage通过 macOS Messages 应用发送和接收 iMessage 消息,支持文本和图片,管理最近聊天记录与联系人列表。
Install via ClawdBot CLI:
clawdbot install lilei0311/imessageiMessage Skill 让 OpenClaw 能够通过 macOS 的 Messages 应用发送和接收 iMessage 消息。
安全增强版特性:
重要提示:
npx clawhub install imessage
首次使用时,系统会提示授予辅助功能权限:
打开 Messages 应用,确认已登录你的 Apple ID。
# 添加可信联系人(免确认发送)
python3 ~/.openclaw/workspace/skills/imessage/scripts/main.py trust phone=+8613800138000
# 移除可信联系人
python3 ~/.openclaw/workspace/skills/imessage/scripts/main.py untrust phone=+8613800138000
# 查看所有可信联系人
python3 ~/.openclaw/workspace/skills/imessage/scripts/main.py list_trusted
# 添加管理员(可远程控制 OpenClaw)
python3 ~/.openclaw/workspace/skills/imessage/scripts/main.py admin phone=+8613800138000
# 移除管理员
python3 ~/.openclaw/workspace/skills/imessage/scripts/main.py unadmin phone=+8613800138000
# 启用远程控制
python3 ~/.openclaw/workspace/skills/imessage/scripts/main.py enable_control
# 禁用远程控制
python3 ~/.openclaw/workspace/skills/imessage/scripts/main.py disable_control
# 发送给可信联系人(无需确认)
python3 ~/.openclaw/workspace/skills/imessage/scripts/main.py send phone=+8613800138000 message="你好"
# 发送给非可信联系人(需要确认)
python3 ~/.openclaw/workspace/skills/imessage/scripts/main.py send phone=+8613900139000 message="测试消息"
# 系统会提示:是否继续发送? (yes/no):
# 发送图片(同样需要安全检查)
python3 ~/.openclaw/workspace/skills/imessage/scripts/main.py send_image phone=+8613800138000 image=/Users/username/Pictures/photo.jpg
# 查看所有最近消息
python3 ~/.openclaw/workspace/skills/imessage/scripts/main.py recent limit=10
# 查看特定联系人的消息
python3 ~/.openclaw/workspace/skills/imessage/scripts/main.py recent phone=+8613800138000 limit=5
# 检查并执行控制命令
python3 ~/.openclaw/workspace/skills/imessage/scripts/main.py recent check_control=true
# 获取最近联系人(显示可信和管理员状态)
python3 ~/.openclaw/workspace/skills/imessage/scripts/main.py contacts limit=20
! 开头的消息管理员可以通过 iMessage 发送以下命令:
!status - 查看 OpenClaw 状态
!help - 显示帮助信息
!list - 列出已安装的 Skills
!info - 显示系统信息
!echo <消息> - 回显消息
!status
OpenClaw 状态
[OpenClaw 状态输出]
! 开头才识别为控制命令编辑 ~/.openclaw/workspace/skills/imessage/config.json:
{
"trusted_contacts": [
"+8613800138000"
],
"admin_contacts": [
"+8613800138000"
],
"require_confirmation": true,
"max_daily_messages": 100,
"enable_logging": true,
"enable_remote_control": false,
"allowed_commands": ["status", "help", "list", "info", "echo"],
"blocked_commands": ["delete", "rm", "remove", "uninstall", "exec", "eval"],
"command_prefix": "!"
}
| 配置项 | 说明 | 默认值 |
|--------|------|--------|
| trusted_contacts | 可信联系人列表 | [] |
| admin_contacts | 管理员列表(可远程控制) | [] |
| require_confirmation | 是否需要发送确认 | true |
| max_daily_messages | 每日最大发送数 | 100 |
| enable_logging | 是否启用安全日志 | true |
| enable_remote_control | 是否启用远程控制 | false |
| allowed_commands | 允许的命令列表 | ["status", "help", "list", "info", "echo"] |
| blocked_commands | 禁止的命令列表 | ["delete", "rm", "remove", "uninstall"] |
| command_prefix | 命令前缀 | "!" |
trusted_contacts 的联系人,发送消息时无需确认发送请求 → 检查可信名单 → 是 → 直接发送
↓ 否
交互式环境? → 是 → 提示确认 → 用户确认 → 发送
↓ 否
拒绝发送
接收消息 → 检测命令前缀 → 是 → 检查远程控制启用
↓ 否
检查管理员权限
↓ 否
检查命令黑名单
↓ 是
检查命令白名单
↓ 否
执行命令 → 发送回复
所有操作记录在 security.log:
{"timestamp": "2026-02-16 10:30:00", "user": "username", "event": "SEND_MESSAGE", "details": {"phone": "+8613800138000", "trusted": true}}
{"timestamp": "2026-02-16 10:35:00", "user": "username", "event": "ADD_ADMIN_CONTACT", "details": {"phone": "+8613800138000"}}
{"timestamp": "2026-02-16 10:40:00", "user": "username", "event": "REMOTE_CONTROL_ENABLED", "details": {}}
控制命令记录在 control.log:
{"timestamp": "2026-02-16 10:45:00", "event": "CONTROL_COMMAND_EXECUTED", "details": {"phone": "+8613800138000", "command": "status", "success": true}}
trust 命令将联系人添加到可信名单admin_contacts 列表中admin 命令添加管理员enable_control 命令启用max_daily_messages 限制注意: 本 Skill 仅用于个人自动化用途,请遵守 Apple 的服务条款,不要用于发送垃圾信息。
Generated Mar 1, 2026
Individuals use the skill to automate sending reminders, notifications, and updates via iMessage to trusted contacts like family or friends. It integrates with OpenClaw to schedule messages or send alerts based on triggers, enhancing daily communication efficiency.
Business owners leverage the skill to send automated order confirmations, shipping updates, or appointment reminders to customers via iMessage. The trusted contact list ensures secure communication, while logging helps track interactions for customer service.
IT administrators enable remote control to monitor system status or execute safe commands on OpenClaw through iMessage from authorized devices. This allows for quick troubleshooting or status checks without direct access, ideal for managing distributed systems.
Event organizers use the skill to send mass updates or last-minute changes to participants via iMessage, with daily limits preventing spam. Trusted contacts ensure reliable delivery, and logs help audit communication for event management.
Schools or training centers employ the skill to send announcements, class updates, or emergency alerts to students and parents through iMessage. The security features like confirmation and logging ensure controlled and traceable communication.
Offer basic messaging features for free, with premium tiers providing increased daily limits, advanced remote control commands, or priority support. Revenue comes from monthly subscriptions, targeting small businesses and power users.
Sell customized versions with enhanced security, integration APIs, and dedicated support to large organizations. Revenue is generated through annual licenses, focusing on industries like IT or education that require robust communication tools.
Provide professional services to help clients set up, customize, and integrate the skill with their existing systems. Revenue comes from project-based fees, appealing to businesses needing tailored automation solutions.
💬 Integration Tip
Ensure proper macOS permissions are granted and test with trusted contacts first to avoid security issues; use the config.json file to customize settings like allowed commands for seamless integration.
iMessage/SMS CLI for listing chats, history, watch, and sending.
Use when you need to control Discord from Clawdbot via the discord tool: send messages, react, post or upload stickers, upload emojis, run polls, manage threads/pins/search, fetch permissions or member/role/channel info, or handle moderation actions in Discord DMs or channels.
Use when you need to control Slack from Clawdbot via the slack tool, including reacting to messages or pinning/unpinning items in Slack channels or DMs.
Send WhatsApp messages to other people or search/sync WhatsApp history via the wacli CLI (not for normal user chats).
Build or update the BlueBubbles external channel plugin for Clawdbot (extension package, REST send/probe, webhook inbound).
OpenClaw skill for designing Telegram Bot API workflows and command-driven conversations using direct HTTPS requests (no SDKs).