plugins/plugin-imessage/README.md
iMessage plugin for ElizaOS agents. Enables chat integration with Apple's iMessage on macOS.
Note: This plugin only works on macOS systems.
# npm
npm install @elizaos/plugin-imessage
# bun
bun add @elizaos/plugin-imessage
| Variable | Description | Required |
|---|---|---|
IMESSAGE_CLI_PATH | Path to iMessage CLI tool | No |
IMESSAGE_DB_PATH | Path to iMessage database | No |
IMESSAGE_POLL_INTERVAL_MS | Polling interval in ms | No |
IMESSAGE_DM_POLICY | DM policy: open, pairing, allowlist, disabled | No |
IMESSAGE_GROUP_POLICY | Group policy: open, allowlist, disabled | No |
IMESSAGE_ALLOW_FROM | Comma-separated handles for allowlist | No |
IMESSAGE_ENABLED | Enable/disable the plugin | No |
{
"plugins": ["@elizaos/plugin-imessage"],
"pluginParameters": {
"IMESSAGE_DM_POLICY": "pairing",
"IMESSAGE_GROUP_POLICY": "allowlist",
"IMESSAGE_POLL_INTERVAL_MS": "5000"
}
}
For enhanced functionality, you can use an iMessage CLI tool like imsg:
# Install a CLI tool (example)
brew install imessage-cli
# Configure the path
IMESSAGE_CLI_PATH=/usr/local/bin/imsg
iMessage sending is exposed through the canonical message connector action. Use
source: "imessage" when a request needs to target iMessage explicitly.
| Primary action | Operation | Description |
|---|---|---|
MESSAGE | send | Send a text message to a phone number, email, contact, or chat |
iMessage does not register standalone planner providers. Chat and contact context is exposed through the iMessage message connector hooks.
The plugin uses two methods to interact with iMessage:
tell application "Messages"
set targetService to 1st account whose service type = iMessage
set targetBuddy to participant "+1234567890" of targetService
send "Hello!" to targetBuddy
end tell
iMessage supports multiple target types:
+1234567890, 1234567890[email protected]chat_id:UUID (for existing chats)| Policy | Description |
|---|---|
open | Accept DMs from anyone |
pairing | Accept DMs and remember senders |
allowlist | Only accept from IMESSAGE_ALLOW_FROM list |
disabled | Don't accept any DMs |
| Policy | Description |
|---|---|
open | Respond to anyone in groups |
allowlist | Only respond to allowed users |
disabled | Don't respond in groups |
cd typescript && npm run build
Testing requires a macOS environment with Messages app configured:
npm test
MIT