Most of our day-to-day talk happens in iMessage. So when we started running AI agents that build and watch things for us, the question was how they would reach us. The answer was not another app. It was a command line.
What is imsg?
imsg is an iMessage tool for the Mac terminal that Cameron wrote and published under the MIT license. It reads the Messages database on your Mac and sends through the Messages app. There is no extra server or account in the middle.
Read, search, send, poll, watch, and stream iMessages from the terminal. Zero runtime dependencies.
The imsg README, github.com/camolechowski/imsg
What can it do?
| Command | What it does |
|---|---|
imsg chats | Lists recent conversations |
imsg read | Shows one conversation |
imsg search | Full-text search, the last 30 days unless you say otherwise |
imsg send | Sends a text, or a file |
imsg watch | Shows new messages live as they arrive |
imsg poll | Returns new messages since a marker, without waiting |
imsg stream | A live feed of events, one line of JSON each, for agents |
imsg doctor | Checks permissions and setup |
Every command takes --json for output a program can read.
How do you set it up?
- Install it
npm i -g imsg-cliorbun add -g imsg-cli. Needs Node 22.13 or newer, or Bun. - Allow Full Disk AccessSystem Settings, Privacy & Security, Full Disk Access: add your terminal, then restart it.
- Check itRun
imsg doctor. Your first real send asks once for permission to control Messages.
To try it without installing: npx -y imsg-cli doctor. It is for macOS only.
How do our agents use it?
- Check for textsimsg poll, on one thread
- Read the replyAs JSON
- Do the workBuild, check, report
- Text backimsg send, same thread
A deploy finishing or a check failing at 2am becomes a text in the conversation we were already in. A bot would need a server, a token and a platform's rules. A command line needs a Mac that is already signed in, and it works with anything: a shell script, a scheduled job, an agent loop.
Can you limit who it texts?
Yes, if you opt in. A small config file can hold an allowlist, so it only sends to and watches the people on it, and confirmSend, so every send needs --yes. Without the file, nothing is restricted. We set our own rules on top for who our agents may text without a person saying so.
Questions people ask
Is imsg free?
Yes. It is open source under the MIT license, on GitHub and on npm as imsg-cli.
Does it work on Windows or Linux?
No. It installs anywhere, but its README says every command except help prints a warning and stops on platforms other than macOS.
Why does it need Full Disk Access?
Your Messages history is a database in your home Library folder (~/Library/Messages/chat.db). The README says reading it requires Full Disk Access for your terminal.
Can an AI agent use it?
Yes. imsg stream prints one JSON line per event and imsg poll returns new messages since a marker, which is what an agent loop needs. The repo also ships instructions written for agents.
More on how we work: how we build, ship and deploy and why we build on Cloudflare.
Next step: run the free AI Read Test on your homepage. It takes a few seconds. Want us to do the work? Book a free call.
Sources: the imsg README and command reference on GitHub, and the imsg-cli package listing, all read November 18, 2026.