BlueBubbles (recommended)
BlueBubbles (recommended) — Preferred iMessage path for new setups.
For new iMessage deployments, use BlueBubbles.
The imsg integration is legacy and may be removed in a future release.
Status: legacy external CLI integration. Gateway spawns imsg rpc and communicates over JSON-RPC on stdio (no separate daemon/port).
BlueBubbles (recommended)
BlueBubbles (recommended) — Preferred iMessage path for new setups.
Pairing
Pairing — iMessage DMs default to pairing mode.
Configuration reference
Configuration reference — Full iMessage field reference.
Install and verify imsg
brew install steipete/tap/imsgimsg rpc --helpConfigure RemoteClaw
{ channels: { imessage: { enabled: true, cliPath: "/usr/local/bin/imsg", dbPath: "/Users/<you>/Library/Messages/chat.db", }, },}Start gateway
remoteclaw gatewayApprove first DM pairing (default dmPolicy)
remoteclaw pairing list imessageremoteclaw pairing approve imessage <CODE>Pairing requests expire after 1 hour.
RemoteClaw only requires a stdio-compatible cliPath, so you can point cliPath at a wrapper script that SSHes to a remote Mac and runs imsg.
#!/usr/bin/env bashexec ssh -T gateway-host imsg "$@"Recommended config when attachments are enabled:
{ channels: { imessage: { enabled: true, cliPath: "~/.remoteclaw/scripts/imsg-ssh", remoteHost: "user@gateway-host", // used for SCP attachment fetches includeAttachments: true, // Optional: override allowed attachment roots. // Defaults include /Users/*/Library/Messages/Attachments attachmentRoots: ["/Users/*/Library/Messages/Attachments"], remoteAttachmentRoots: ["/Users/*/Library/Messages/Attachments"], }, },}If remoteHost is not set, RemoteClaw attempts to auto-detect it by parsing the SSH wrapper script.
remoteHost must be host or user@host (no spaces or SSH options).
RemoteClaw uses strict host-key checking for SCP, so the relay host key must already exist in ~/.ssh/known_hosts.
Attachment paths are validated against allowed roots (attachmentRoots / remoteAttachmentRoots).
imsg.imsg (Messages DB access).Permissions are granted per process context. If gateway runs headless (LaunchAgent/SSH), run a one-time interactive command in that same context to trigger prompts:
imsg chats --limit 1# orimsg send <handle> "test"channels.imessage.dmPolicy controls direct messages:
pairing (default)allowlistopen (requires allowFrom to include "*")disabledAllowlist field: channels.imessage.allowFrom.
Allowlist entries can be handles or chat targets (chat_id:*, chat_guid:*, chat_identifier:*).
channels.imessage.groupPolicy controls group handling:
allowlist (default when configured)opendisabledGroup sender allowlist: channels.imessage.groupAllowFrom.
Runtime fallback: if groupAllowFrom is unset, iMessage group sender checks fall back to allowFrom when available.
Runtime note: if channels.imessage is completely missing, runtime falls back to groupPolicy="allowlist" and logs a warning (even if channels.defaults.groupPolicy is set).
Mention gating for groups:
agents.list[].groupChat.mentionPatterns, fallback messages.groupChat.mentionPatterns)Control commands from authorized senders can bypass mention gating in groups.
session.dmScope=main, iMessage DMs collapse into the agent main session.agent:<agentId>:imessage:group:<chat_id>).Group-ish thread behavior:
Some multi-participant iMessage threads can arrive with is_group=false.
If that chat_id is explicitly configured under channels.imessage.groups, RemoteClaw treats it as group traffic (group gating + group session isolation).
Use a dedicated Apple ID and macOS user so bot traffic is isolated from your personal Messages profile.
Typical flow:
imsg in that user.imsg in that user context.channels.imessage.accounts.<id>.cliPath and .dbPath to that user profile.First run may require GUI approvals (Automation + Full Disk Access) in that bot user session.
Common topology:
imsg runs on a Mac in your tailnetcliPath wrapper uses SSH to run imsgremoteHost enables SCP attachment fetchesExample:
{ channels: { imessage: { enabled: true, cliPath: "~/.remoteclaw/scripts/imsg-ssh", remoteHost: "bot@mac-mini.tailnet-1234.ts.net", includeAttachments: true, dbPath: "/Users/bot/Library/Messages/chat.db", }, },}#!/usr/bin/env bashexec ssh -T bot@mac-mini.tailnet-1234.ts.net imsg "$@"Use SSH keys so both SSH and SCP are non-interactive.
Ensure the host key is trusted first (for example ssh bot@mac-mini.tailnet-1234.ts.net) so known_hosts is populated.
iMessage supports per-account config under channels.imessage.accounts.
Each account can override fields such as cliPath, dbPath, allowFrom, groupPolicy, mediaMaxMb, history settings, and attachment root allowlists.
channels.imessage.includeAttachmentsremoteHost is setchannels.imessage.attachmentRoots (local)channels.imessage.remoteAttachmentRoots (remote SCP mode)/Users/*/Library/Messages/AttachmentsStrictHostKeyChecking=yes)channels.imessage.mediaMaxMb (default 16 MB)channels.imessage.textChunkLimit (default 4000)channels.imessage.chunkMode
length (default)newline (paragraph-first splitting)Preferred explicit targets:
chat_id:123 (recommended for stable routing)chat_guid:...chat_identifier:...Handle targets are also supported:
imessage:+1555...sms:+1555...user@example.comimsg chats --limit 20iMessage allows channel-initiated config writes by default (for /config set|unset when commands.config: true).
Disable:
{ channels: { imessage: { configWrites: false, }, },}Validate the binary and RPC support:
imsg rpc --helpremoteclaw channels status --probeIf probe reports RPC unsupported, update imsg.
Check:
channels.imessage.dmPolicychannels.imessage.allowFromremoteclaw pairing list imessage)Check:
channels.imessage.groupPolicychannels.imessage.groupAllowFromchannels.imessage.groups allowlist behavioragents.list[].groupChat.mentionPatterns)Check:
channels.imessage.remoteHostchannels.imessage.remoteAttachmentRoots~/.ssh/known_hosts on the gateway hostRe-run in an interactive GUI terminal in the same user/session context and approve prompts:
imsg chats --limit 1imsg send <handle> "test"Confirm Full Disk Access + Automation are granted for the process context that runs RemoteClaw/imsg.