macOS Messages CLI for listing chats, reading history, watching new messages, and sending iMessage or SMS.
$make build
Agent Compatibility
JSON Output
Agent Skill
MCP Support
AI Analysis
imsg is a macOS CLI for Apple Messages that reads the local chat database and sends through Messages.app. It covers inbox inspection, live message streaming, and outbound texting from the shell.
What It Enables
- List recent chats, inspect message history, and filter messages by participants or time range.
- Stream new messages, attachments, and optional tapback reaction events as JSON lines for automations.
- Send texts, files, and tapback reactions to direct or group chats, or keep a stdio JSON-RPC process open for longer-lived workflows.
Agent Fit
--jsonoutput is implemented across the main read paths plus send and react acknowledgements, so agents can parse chats, messages, and event streams without scraping text.imsg rpcexposes chats, history, watch subscriptions, and send over JSON-RPC 2.0 on stdin/stdout, which fits subprocess-based agent loops well.- Fit is local-Mac only: it depends on Messages.app state and macOS permissions, and reaction sending uses UI automation rather than a fully headless API.
Caveats
- Requires macOS 14+, Messages signed in, and Full Disk Access to read
~/Library/Messages/chat.db. - Sending needs Automation permission, SMS relay is optional for SMS, and
reactalso depends on UI automation with Messages.app running.