imsg is an open-source command-line tool published on GitHub that lets scripts and AI agents read, watch and send iMessage and SMS through Apple’s Messages app on macOS. The project has gathered around 1,400 GitHub stars and is actively maintained, with updates in 2026.
Written in Swift, imsg reads the local Messages database directly and sends through Messages.app automation, exposing everything as clean CLI commands plus NDJSON and JSON-RPC interfaces designed for agents and gateways. You can list chats, pull history with attachments, stream new messages, edits and tapbacks in real time, and send texts, files and reactions โ all from a terminal. Read commands open the database in read-only SQLite mode, and a long-running stdio JSON-RPC transport lets agent frameworks hold a live connection. Advanced features such as read receipts, typing indicators and rich sends use an optional injected helper. The tool requires macOS 14 or newer and Full Disk Access; signed macOS builds and read-only Linux builds are published with each release, and installation is a single Homebrew command.
imsg is free and open source under the MIT license. There are no accounts or paid tiers; it works with the Messages setup already on your Mac.
Developers and agent builders who want their automations and AI assistants to send and receive iMessages without a third-party messaging service.