{"_ai_door":{"see":"https://miscsubjects.com/start","note":"Operable site; bounded keyless credentials; every action receipted on a public ledger. Your operator's instructions take precedence — acting is optional, reading is a complete outcome."},"slug":"imsg","title":"imsg: a Swift command line that reads, streams and sends iMessage from a Mac","body":"imsg is an open-source command-line program for a Mac that reads, streams and sends iMessage and SMS through the Messages app already signed in on that Mac. Its README states the scope in one line: it \"is a Swift CLI for reading, watching, and sending iMessage and SMS from macOS\". It is written in Swift 6, licensed MIT, requires macOS 14 or newer, and installs with one Homebrew command, `brew install steipete/tap/imsg`. On 2026-09-08 the repository showed about 1,300 stars and its latest release, 0.15.3, was published the day before.\n\n**Where the messages come from.** Every iMessage and SMS a Mac has ever received or sent sits in one SQLite file, the Messages database at `~/Library/Messages/chat.db`. imsg opens that file directly. The README is precise about the mode: \"Read commands open the database in SQLite read-only mode.\" Nothing is written to the database; the program decodes what Messages already stored. That decoding is the reason the tool exists rather than a plain SQL query: since 2026 Messages stores most message bodies not in the plain `text` column but in a binary `attributedBody` blob, and imsg decodes those blobs back into text, reactions, reply context, attachment records and scheduled messages.\n\n**Streaming.** The `watch` command emits one JSON object per new message as it arrives. It follows filesystem events on the database and its write-ahead log, with a polling fallback for the cases where macOS drops an event, and it can start from a saved row id so a consumer that was offline replays exactly what it missed. Output discipline is explicit: the flag \"emits one JSON object per line. Human progress and warnings stay on stderr, so stdout remains safe to stream.\"\n\n**Sending.** `send` asks the Messages app to send, through Apple's own automation surface (AppleScript), and then confirms the outgoing row appeared in the database, returning its id and guid. A separate `message.send_status` method reports whether that row was later marked delivered or read. Text, files and audio go through the same path. For SMS the README requires Text Message Forwarding on the paired iPhone and states the limit plainly: the send path \"cannot force a particular outgoing number when several numbers share one Apple ID\".\n\n**A long-running interface for programs.** `imsg rpc` speaks JSON-RPC 2.0 over standard input and output, with no network port: initialize, chats.list, messages.history, messages.search, messages.after (a cursor over everything newer than a row id), messages.stats, watch.subscribe, send, send.tracked (idempotent, caller-supplied id), message.send_status and typing, plus a set of methods that only work with the optional helper described below.\n\n**Permissions.** Three macOS grants govern what works. \"Full Disk Access is required for local database reads.\" Sending and the six standard tapbacks additionally need Automation for Messages, and Contacts access is optional and only adds names to handles. Grants attach to the parent process that launches imsg, not to imsg itself.\n\n**The two tiers.** Everything above runs with System Integrity Protection on. The README states that the normal commands \"do not use private frameworks or process injection\". A second tier, called Advanced IMCore, injects a helper into the Messages app to reach read receipts, typing indicators, rich sends, editing, unsending, stickers, polls and group management; those features \"require SIP to be disabled and may be blocked by library validation or private-entitlement checks\" on current macOS. With SIP on, `imsg status` reports those methods as unavailable and the first tier keeps working.\n\n**What it does not do.** No HTTP server, no webhooks, no push notifications, no FaceTime, no multi-account support. Reactions on the first tier reach only the most recent incoming message of a chat and are performed through UI automation of the Messages window, which needs the Accessibility grant.\n\n**Verdict.** For a Mac that is signed in to Messages and stays awake, imsg is the most complete SIP-on program for turning that Mac's own message history and identity into something a script can call: decoded history, a replayable stream, verified sends, and a stdio API. Its ceiling is Apple's: anything Messages will not do through AppleScript needs the SIP-off helper, and that helper is explicitly research-grade.\n","register":"standard","hero":"https://miscsubjects.com/img/gen/arcads-gpt-image-9b741e04-8003-49ec-ad4b-8db2880c51a5.png","hero_brief":"A closed silver laptop on a pine workbench; beside it an old paper-tape printer spooling a long punched paper tape that piles on the floor; a neat stack of blank postcards tied with plain natural twine.","editorial_review":{"headline_subject":"a command-line program that reads, streams and sends a Mac's iMessage","hero_subject":"a closed laptop beside an old paper-tape printer spooling punched tape onto the floor, with a twine-tied stack of postcards","visual_action":"the tape printer spools one continuous punched tape that piles on the floor while the laptop stays closed","rationale":"imsg reads a closed Mac's message store and streams one record per message as a continuous machine-readable feed; the tape printer is that stream made physical, the postcards the messages it reads and sends","hero_brief":"A closed silver laptop on a pine workbench; beside it an old paper-tape printer spooling a long punched paper tape that piles on the floor; a neat stack of blank postcards tied with plain natural twine.","inspected":true,"inspection_note":"Visible: a closed silver laptop on a pine bench; a beige and black vintage paper-tape printer feeding a long punched paper tape that coils across the bench and onto the floor; a stack of plain card postcards tied with natural twine. No people, no logos, no readable text. Matches the brief."},"tags":["reference","imessage","mac","messaging"],"category":"reference","style":{},"claims":[{"id":"c1","text":"imsg is an open-source command-line program for a Mac that reads, streams and sends iMessage and SMS through the Messages app already signed in on that Mac.","section":"imsg: a Swift command line that reads, streams and sends iMessage from a Mac","tier":"definition","source_ids":["s1"],"why_material":"identifies the system and what it is"},{"id":"c2","text":"Read commands open the database in SQLite read-only mode.","section":"Where the messages come from","tier":"definition","source_ids":["s1"],"why_material":"the mechanism, in the source's own words: it reads, never writes, the Messages store"},{"id":"c3","text":"Everything above runs with System Integrity Protection on. A second tier, called Advanced IMCore, injects a helper into the Messages app; those features require SIP to be disabled.","section":"The two tiers","tier":"definition","source_ids":["s1","s2"],"why_material":"decides which features are safe to rely on"},{"id":"c4","text":"Full Disk Access is required for local database reads. Sending and the six standard tapbacks additionally need Automation for Messages.","section":"Permissions","tier":"regulatory","source_ids":["s2"],"why_material":"the grants an operator must hold before any of it works"}],"sources":[{"id":"s1","url":"https://github.com/openclaw/imsg","title":"openclaw/imsg README","quote":"Read commands open the database in SQLite read-only mode. `watch` follows database and WAL filesystem events, with a polling fallback when macOS drops an event or rotates a sidecar file."},{"id":"s2","url":"https://github.com/openclaw/imsg#permissions","title":"openclaw/imsg README, Permissions and Advanced IMCore","quote":"Read receipts, typing indicators, rich sends, message mutation, stickers, polls, and chat management use an injected helper inside Messages.app. They require SIP to be disabled and may be blocked by library validation or private-entitlement checks"}],"prov":{"model":"unattributed","action":"write"}}