Send iMessages and SMS from Your AI Agent with the imsg Skill
Ever wanted your AI agent to read your iMessages or send a quick text on your behalf? The imsg skill brings iMessage and SMS capabilities directly into your Clawdbot workflow, letting you list conversations, read message history, watch for incoming messages in real-time, and even send texts—all from the command line.
Who Is This For?
The imsg skill is perfect for macOS users who want to:
- Build automated messaging workflows (e.g., "text me when the deployment finishes")
- Search through message history programmatically
- Monitor specific conversations for incoming messages
- Send quick texts without opening Messages.app
If you've ever wished your AI assistant could interact with your iMessages the same way it handles email or calendar, this skill is for you.
Installation
First, install the skill from ClawdHub:
npx clawhub@latest install imsgNext, install the imsg CLI tool via Homebrew:
brew install steipete/tap/imsgRequired Permissions
The imsg tool needs two key macOS permissions to function:
-
Full Disk Access for your terminal app (Terminal, iTerm2, Warp, etc.)
- Go to System Settings → Privacy & Security → Full Disk Access
- Add your terminal application
-
Automation permission to control Messages.app (required for sending)
- macOS will prompt you the first time you try to send a message
- Make sure to click "Allow"
Also ensure that Messages.app is signed in to your Apple ID.
Basic Usage
List Your Chats
View your recent conversations with the chats command:
# List last 10 chats
imsg chats --limit 10
# Get JSON output for scripting
imsg chats --limit 20 --jsonThe output includes chat IDs, participant names, and message counts—everything you need to identify which conversation to interact with.
Read Message History
Once you have a chat ID, pull up the conversation history:
# Get last 20 messages from chat ID 1
imsg history --chat-id 1 --limit 20
# Include attachment info
imsg history --chat-id 1 --limit 50 --attachments
# JSON output for parsing
imsg history --chat-id 1 --jsonThe --attachments flag includes metadata about any images, files, or media in the conversation.
Watch for New Messages
Need to monitor a conversation in real-time? The watch command streams incoming messages:
# Watch chat ID 1 for new messages
imsg watch --chat-id 1
# Include attachment data
imsg watch --chat-id 1 --attachmentsThis is particularly useful for building reactive workflows—your agent can wait for a specific response before proceeding with the next step.
Send Messages
The most powerful feature: sending messages directly:
# Send a text to a phone number
imsg send --to "+14155551212" --text "Deployment complete!"
# Send to an email (for iMessage contacts)
imsg send --to "friend@icloud.com" --text "Quick question..."
# Attach a file
imsg send --to "+14155551212" --text "Here's the report" --file /path/to/report.pdfService Selection
Control whether messages go via iMessage or SMS:
# Force iMessage only
imsg send --to "+14155551212" --text "Hi" --service imessage
# Force SMS only
imsg send --to "+14155551212" --text "Hi" --service sms
# Auto-select (default)
imsg send --to "+14155551212" --text "Hi" --service autoPro Tips
-
Always confirm before sending: Have your agent show you the recipient and message content before executing the send command—you don't want accidental texts going to the wrong person.
-
Use JSON output for parsing: When building automations, the
--jsonflag makes it easy to extract specific data from responses. -
Combine with cron jobs: Pair imsg with Clawdbot's cron feature to send scheduled reminders or daily summaries.
-
Watch mode for interactive workflows: Use
watchto create back-and-forth conversational flows where your agent responds to specific keywords. -
Handle rate limits: If you're sending many messages, space them out to avoid triggering Apple's spam detection.
Example Workflow
Here's a practical example—have your agent notify you when a long-running task completes:
User: "Deploy to production and text me when it's done"
Agent: [runs deployment]
Agent: [deployment succeeds]
Agent: imsg send --to "+14155551212" --text "🚀 Production deployment complete at 3:45 PM"
Conclusion
The imsg skill turns your Clawdbot into a messaging powerhouse on macOS. Whether you're automating notifications, searching through conversations, or building interactive text-based workflows, it's a natural extension of your AI assistant's capabilities.
Install it now:
npx clawhub@latest install imsg
brew install steipete/tap/imsgHappy texting! 📱
Skill page: imsg on ClawdHub
Comments (0)
No comments yet. Be the first to comment!