imessage by letta-ai/skills
npx skills add https://github.com/letta-ai/skills --skill imessage在 macOS 上使用 imsg CLI 工具发送和读取 iMessage/短信。
克隆并构建该工具:
git clone https://github.com/letta-ai/imsg.git ~/repos/imsg
cd ~/repos/imsg
swift build -c release
二进制文件将位于 ~/repos/imsg/.build/release/imsg(或者使用预构建的二进制文件,如果 ~/repos/imsg/bin/imsg 处有的话)。
所需的 macOS 权限(系统设置 → 隐私与安全性):
| 权限 | 位置 | 用途 |
|---|---|---|
| 完全磁盘访问权限 | 隐私与安全性 → 完全磁盘访问权限 | 读取消息历史记录 |
| 自动化 | 隐私与安全性 → 自动化 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 通过 Messages.app 发送消息 |
要向非 iMessage 用户发送短信(绿色气泡):
imsg chats --limit 10
imsg chats --limit 10 --json
输出格式:[chat_id] (identifier) last=timestamp
# 查看聊天中的最后 20 条消息
imsg history --chat-id <id> --limit 20
# 包含附件元数据
imsg history --chat-id <id> --limit 20 --attachments
# 按日期筛选
imsg history --chat-id <id> --start 2026-01-01T00:00:00Z --json
# 发送到电话号码
imsg send --to "+15555555555" --text "Hello!"
# 发送带附件的消息
imsg send --to "+15555555555" --text "Here's the file" --file /path/to/file.jpg
# 强制使用 iMessage 或短信
imsg send --to "+15555555555" --text "Hi" --service imessage
imsg send --to "+15555555555" --text "Hi" --service sms
# 通过 ID 发送到现有聊天
imsg send --chat-id 86 --text "Hello!"
imsg watch --chat-id <id> --debounce 250ms
+1XXXXXXXXXX--service smsimsg send --to "+14155551234" --text "Hi! Do you have availability this Saturday for a cleaning?"
imsg send --to "+14155551234" --text "Just wanted to follow up on my earlier message. Let me know when you have a chance!"
imsg send --to "+14155551234" --text "Confirming our appointment for Saturday at 10am. See you then!"
| 问题 | 解决方案 |
|---|---|
| "未授权"错误 | 向终端授予自动化权限 |
| 无法读取消息 | 向终端授予完全磁盘访问权限 |
| 短信发送失败 | 在 iPhone 上启用短信转发 |
| 消息卡在发送中 | 检查 Messages.app 是否已登录且正常工作 |
~/repos/imsg/bin/imsg(根据需要调整路径)每周安装量
96
代码仓库
GitHub 星标数
74
首次出现
2026年1月24日
安全审计
安装于
opencode84
gemini-cli83
codex82
cursor76
github-copilot75
cline69
Send and read iMessages/SMS using the imsg CLI tool on macOS.
Clone and build the tool:
git clone https://github.com/letta-ai/imsg.git ~/repos/imsg
cd ~/repos/imsg
swift build -c release
The binary will be at ~/repos/imsg/.build/release/imsg (or use the pre-built binary if available at ~/repos/imsg/bin/imsg).
Required macOS permissions (System Settings → Privacy & Security):
| Permission | Location | Required For |
|---|---|---|
| Full Disk Access | Privacy & Security → Full Disk Access | Reading message history |
| Automation | Privacy & Security → Automation | Sending messages via Messages.app |
To send SMS (green bubbles) to non-iMessage users:
imsg chats --limit 10
imsg chats --limit 10 --json
Output format: [chat_id] (identifier) last=timestamp
# View last 20 messages in a chat
imsg history --chat-id <id> --limit 20
# With attachments metadata
imsg history --chat-id <id> --limit 20 --attachments
# Filter by date
imsg history --chat-id <id> --start 2026-01-01T00:00:00Z --json
# Send to phone number
imsg send --to "+15555555555" --text "Hello!"
# Send with attachment
imsg send --to "+15555555555" --text "Here's the file" --file /path/to/file.jpg
# Force iMessage or SMS
imsg send --to "+15555555555" --text "Hi" --service imessage
imsg send --to "+15555555555" --text "Hi" --service sms
# Send to existing chat by ID
imsg send --chat-id 86 --text "Hello!"
imsg watch --chat-id <id> --debounce 250ms
+1XXXXXXXXXX for US numbers--service sms when recipient doesn't have iMessageimsg send --to "+14155551234" --text "Hi! Do you have availability this Saturday for a cleaning?"
imsg send --to "+14155551234" --text "Just wanted to follow up on my earlier message. Let me know when you have a chance!"
imsg send --to "+14155551234" --text "Confirming our appointment for Saturday at 10am. See you then!"
| Issue | Solution |
|---|---|
| "not authorized" error | Grant Automation permission to terminal |
| Can't read messages | Grant Full Disk Access to terminal |
| SMS not sending | Enable Text Message Forwarding on iPhone |
| Message stuck sending | Check Messages.app is signed in and working |
~/repos/imsg/bin/imsg (adjust path as needed)Weekly Installs
96
Repository
GitHub Stars
74
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykPass
Installed on
opencode84
gemini-cli83
codex82
cursor76
github-copilot75
cline69
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
44,900 周安装