SuperAPI AI 工具集

imsg

通用与其它

查看项目

更新于 10-15 23:33

技能介绍

用途:在 macOS 终端通过 imsg CLI 读取和发送 iMessage 与 SMS,适合自动化通知、查看会话与监听新消息。

安装:brew install steipete/tap/imsg

主要命令:列出会话 imsg chats --limit 10 --json;读取历史 imsg history --chat-id <id> --limit 20 --attachments --json;监听新消息 imsg watch --chat-id <id> --attachments;发送 imsg send --to "user@example.com" --text "hello",也可用电话号码或加 --file /path/to/file.jpg 带附件。

前置条件:Messages.app 需登录指定 Apple ID;读取(chats、history、watch)需为终端授予 Full Disk Access;发送需授予 Messages.app 的自动化权限。

限制与注意事项:imsg send 返回 "sent" 仅表示 AppleScript 已触发,不确认送达;Messages.app 显示 "Not delivered" 才是真正失败。缺少 Full Disk Access 时读取命令报 permissionDenied,发送仍可用。消息显示来自该 Apple ID 而非 Joel。默认只读,发送前应确认收件人和内容;读取建议加 --json。

Flagg 环境:读取不要从终端调用 imsg,改用 Executor 保存的连接(签名服务持有 Full Disk Access)。工具包括 imsg_status、imsg_chats、imsg_group、imsg_history、imsg_send,先调用 imsg_status。服务为 LaunchAgent com.joel.imsg-mcp,监听 127.0.0.1:4793;健康检查 curl -s http://127.0.0.1:4793/healthz,重启 launchctl kickstart -k gui/501/com.joel.imsg-mcp。imsg_send 需 Joel 明确批准收件人与文本,附件仅限 ~/.joelclaw/imsg-outbox 或 /tmp;发送被终止会返回 "outcome unknown",重试前先查 Messages.app。Bearer 令牌存放于 agent-secrets,切勿打印。