skills/imessage/SKILL.md
Read and send iMessages on macOS. Use when the user wants to view their messages, search conversations, list contacts, send messages, view attachments, access group chats, or get messaging statistics. Requires Full Disk Access permission granted to the host application.
npx skillsauth add moldable-ai/skills imessageInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Full-featured iMessage API for macOS. All scripts are TypeScript and run via npx tsx.
tsx available (npx tsx)cd ~/.moldable/shared/skills/local/imessage/scripts
List all contacts ordered by most recent message.
npx tsx listContacts.ts [--limit N]
Output: [{ id, messageCount, lastMessageDate }]
List recent messages with optional filters.
npx tsx listMessages.ts [--contact "id"] [--limit N] [--search "text"]
Output: [{ date, sender, isFromMe, text }]
Advanced search with date range support.
npx tsx searchMessages.ts --query "term" [--contact "id"] [--limit N] [--from "YYYY-MM-DD"] [--to "YYYY-MM-DD"]
Output: [{ date, contact, sender, isFromMe, text }]
Get full threaded conversation in chronological order.
npx tsx getConversation.ts --contact "id" [--limit N] [--before "YYYY-MM-DD"] [--after "YYYY-MM-DD"]
Output: { contact, messageCount, firstMessageDate, lastMessageDate, messages: [...] }
Get a single message by ID with full metadata.
npx tsx getMessage.ts --id <messageId>
Output: { id, date, sender, isFromMe, text, contact, service, hasAttachment, attachmentCount, isRead, dateSent, dateDelivered, dateRead }
Get detailed stats about a specific contact.
npx tsx getContact.ts --contact "id"
Output: { id, service, totalMessages, messagesSent, messagesReceived, firstMessageDate, lastMessageDate, attachmentCount, avgMessagesPerDay }
Send an iMessage to a contact.
npx tsx sendMessage.ts --to "id" --message "text"
Output: { success, to, message, error? }
⚠️ Always confirm with the user before sending.
Send an image or file via iMessage.
npx tsx sendAttachment.ts --to "id" --file "/path/to/file.jpg" [--message "caption"]
Output: { success, to, file, message?, error? }
⚠️ Always confirm with the user before sending.
List attachments with optional filters.
npx tsx listAttachments.ts [--contact "id"] [--type "image|video|audio|document"] [--limit N]
Output: [{ id, messageId, date, contact, isFromMe, filename, mimeType, filePath, fileSize, type }]
Get attachment details and resolved file path.
npx tsx getAttachment.ts --id <attachmentId>
Output: { id, messageId, date, contact, filename, mimeType, filePath, resolvedPath, fileSize, fileExists, messageText }
List all group chat conversations.
npx tsx listGroupChats.ts [--limit N]
Output: [{ id, chatIdentifier, displayName, participantCount, participants, messageCount, lastMessageDate }]
Get messages from a specific group chat.
npx tsx getGroupChat.ts --id <chatId> [--limit N]
Output: { id, chatIdentifier, displayName, participants, messageCount, messages: [...] }
Send a message to an existing group chat.
npx tsx sendGroupMessage.ts --id <chatId> --message "text"
Output: { success, chatId, chatName, message, error? }
⚠️ Always confirm with the user before sending.
Create a new group chat and send an initial message.
npx tsx createGroupChat.ts --participants "id1,id2,id3" --message "Hello everyone!"
Options:
--participants - Comma-separated emails or phone numbers (required, min 2)--message - Initial message to send (required)Output: { success, participants, message, method?, error? }
⚠️ Note: Due to macOS AppleScript limitations, this may open Messages with a pre-filled compose window requiring manual Enter to send.
⚠️ Always confirm with the user before sending.
Get message statistics and insights.
npx tsx getStats.ts [--contact "id"] [--year YYYY]
Output:
{
"totalMessages": 12345,
"messagesSent": 5678,
"messagesReceived": 6667,
"totalContacts": 89,
"totalAttachments": 456,
"firstMessageDate": "2020-01-01 12:00:00",
"lastMessageDate": "2026-01-22 12:00:00",
"topContacts": [{ "contact": "...", "count": 1234 }],
"messagesByMonth": [{ "month": "2026-01", "count": 500 }],
"messagesByDayOfWeek": [{ "day": "Monday", "count": 1500 }],
"averageMessagesPerDay": 5.67,
"longestStreak": 45
}
Export a conversation to JSON, Markdown, or plain text.
npx tsx exportConversation.ts --contact "id" [--format json|markdown|text] [--output "/path/to/file"] [--limit N]
Formats:
json - Structured JSON with metadatamarkdown - Formatted Markdown with headers by datetext - Plain text, easy to readOutput: Content to stdout, or writes to file if --output specified.
The iMessage database is at ~/Library/Messages/chat.db.
Key tables:
message - All messages (ROWID, text, date, is_from_me, handle_id)handle - Contacts (ROWID, id [email/phone], service)chat - Conversations (group chats)chat_message_join - Links chats to messagesattachment - File attachmentsmessage_attachment_join - Links messages to attachmentsDate conversion: datetime(date/1000000000 + 978307200, 'unixepoch', 'localtime')
development
Search, scrape, crawl, map, parse, and operate Firecrawl browser/agent workflows through aivault-backed Firecrawl API capabilities. No Firecrawl API key is read by the skill runtime.
data-ai
Manage Trello boards/lists/cards via aivault-backed capabilities (no Trello key/token in skill runtime).
documentation
Manage Todoist tasks/projects/comments via aivault-backed capabilities (no Todoist token in skill runtime).
development
Transcribe local audio files with OpenAI speech-to-text through aivault capability json (no provider API key in skill runtime).