packages/docs/connectors/imessage.md
Connect your agent to iMessage for private chats and group conversations on macOS using the @elizaos/plugin-imessage package.
~/Library/Messages/chat.db)cliPath config field to the absolute path of the binary| Name | Required | Description |
|---|---|---|
IMESSAGE_ENABLED | No | Enable or disable the connector |
IMESSAGE_CLI_PATH | No | Path to the iMessage CLI tool executable |
IMESSAGE_DB_PATH | No | Path to the iMessage database (default: ~/Library/Messages/chat.db) |
IMESSAGE_DM_POLICY | No | DM policy (e.g., allow, deny, allowlist) |
IMESSAGE_ALLOW_FROM | No | Comma-separated allowed sender list |
IMESSAGE_GROUP_POLICY | No | Group message policy |
IMESSAGE_POLL_INTERVAL_MS | No | Polling interval in milliseconds |
The connector auto-enables when cliPath is truthy in the connector config and enabled is not explicitly false.
Configure in ~/.eliza/eliza.json:
{
"connectors": {
"imessage": {
"cliPath": "/usr/local/bin/imessage",
"service": "auto",
"dmPolicy": "pairing"
}
}
}
To disable:
{
"connectors": {
"imessage": {
"cliPath": "/usr/local/bin/imessage",
"enabled": false
}
}
}
connectors.imessage.cliPath in your config.| Variable | Description |
|---|---|
IMESSAGE_CLI_PATH | Path to the iMessage CLI tool executable |
IMESSAGE_DB_PATH | Path to the iMessage database |
IMESSAGE_ENABLED | Set to true to enable |
IMESSAGE_DM_POLICY | DM access policy |
IMESSAGE_ALLOW_FROM | Comma-separated list of allowed user IDs |
IMESSAGE_GROUP_POLICY | Group join policy |
IMESSAGE_POLL_INTERVAL_MS | Polling interval in milliseconds |
| Variable | Required | Description |
|---|---|---|
IMESSAGE_CLI_PATH | No | Path to the iMessage CLI tool executable |
IMESSAGE_DB_PATH | No | Path to the iMessage database |
IMESSAGE_ENABLED | No | Enable or disable the connector |
IMESSAGE_DM_POLICY | No | DM policy (e.g., allow, deny, allowlist) |
IMESSAGE_ALLOW_FROM | No | Comma-separated allowed sender list |
IMESSAGE_GROUP_POLICY | No | Group message policy |
IMESSAGE_POLL_INTERVAL_MS | No | Polling interval in milliseconds |
All fields are defined under connectors.imessage in eliza.json.
| Field | Type | Default | Description |
|---|---|---|---|
cliPath | string | — | Path to the iMessage CLI tool executable |
dbPath | string | — | Path to the iMessage database (default: ~/Library/Messages/chat.db) |
remoteHost | string | — | Remote Mac hostname for SSH-based iMessage access |
service | "imessage" | "sms" | "auto" | — | Message service selection. "auto" detects the appropriate service |
region | string | — | Region configuration for phone number formatting |
name | string | — | Account display name |
enabled | boolean | — | Explicitly enable/disable |
capabilities | string[] | — | Capability flags |
includeAttachments | boolean | — | Include attachments in messages |
configWrites | boolean | — | Allow config writes from iMessage events |
dmPolicy | "pairing" | "allowlist" | "open" | "disabled" | "pairing" | DM access policy. "open" requires allowFrom to include "*" |
allowFrom | (string|number)[] | — | User IDs allowed to DM |
groupPolicy | "open" | "disabled" | "allowlist" | "allowlist" | Group join policy |
groupAllowFrom | (string|number)[] | — | User IDs allowed in groups |
historyLimit | integer >= 0 | — | Max messages in context |
dmHistoryLimit | integer >= 0 | — | History limit for DMs |
dms | object | — | Per-DM history overrides keyed by DM ID. Each value: {historyLimit?: int} |
textChunkLimit | integer > 0 | — | Max characters per message chunk |
chunkMode | "length" | "newline" | — | Long message splitting strategy |
mediaMaxMb | integer > 0 | — | Max media file size in MB |
markdown | object | — | Table rendering: tables can be "off", "bullets", or "code" |
| Field | Type | Default | Description |
|---|---|---|---|
blockStreaming | boolean | — | Disable streaming entirely |
blockStreamingCoalesce | object | — | Coalescing settings: minChars, maxChars, idleMs |
Per-group settings are defined under groups.<group-id>:
| Field | Type | Description |
|---|---|---|
requireMention | boolean | Only respond when @mentioned |
tools | ToolPolicySchema | Tool access policy |
toolsBySender | object | Per-sender tool policies (keyed by sender ID) |
{
"connectors": {
"imessage": {
"heartbeat": {
"showOk": true,
"showAlerts": true,
"useIndicator": true
}
}
}
}
The accounts field allows running multiple iMessage accounts from a single agent:
{
"connectors": {
"imessage": {
"accounts": {
"personal": {
"cliPath": "/usr/local/bin/imessage",
"service": "imessage",
"groups": {}
},
"work": {
"cliPath": "/usr/local/bin/imessage",
"remoteHost": "work-mac.local",
"service": "auto",
"groups": {}
}
}
}
}
}
Each account entry supports the same fields as the top-level connectors.imessage configuration (excluding the accounts field itself).
To connect to iMessage on a remote Mac via SSH, set the remoteHost field:
{
"connectors": {
"imessage": {
"cliPath": "/usr/local/bin/imessage",
"remoteHost": "mac-mini.local"
}
}
}
Ensure SSH key-based authentication is configured between the local machine and the remote host.
If message retrieval fails, ensure Full Disk Access is granted:
The default iMessage database is at ~/Library/Messages/chat.db. If using a non-standard location, set dbPath explicitly.
The iMessage connector requires macOS. It will not function on Linux or Windows.