GitHub - aditya-r123/iMessage-Bot: AI that automatically crafts and sends replies to your contacts and group chats · GitHub
/" data-turbo-transient="true" />
Skip to content
Search or jump to...
Search code, repositories, users, issues, pull requests...
-->
Search
Clear
Search syntax tips
Provide feedback
--><br>We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Cancel
Submit feedback
Saved searches
Use saved searches to filter your results more quickly
-->
Name
Query
To see all available qualifiers, see our documentation.
Cancel
Create saved search
Sign in
/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up
Appearance settings
Resetting focus
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
aditya-r123
iMessage-Bot
Public
Notifications<br>You must be signed in to change notification settings
Fork
Star
main
BranchesTags
Go to file
CodeOpen more actions menu
Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit
History<br>17 Commits<br>17 Commits
.env.example
.env.example
.gitignore
.gitignore
README.md
README.md
bot.py
bot.py
db.py
db.py
gui.py
gui.py
messaging.py
messaging.py
requirements.txt
requirements.txt
View all files
Repository files navigation
iMessage Bot
Drafts a reply to your most recent iMessage DM or group chat using OpenAI, then previews it before sending. Pick a chat from the tabbed picker (DMs / Group Chats), edit the AI draft, hit Send. If the draft has paragraphs separated by blank lines, each is sent as its own iMessage.
Setup
1. Create a venv
python3 -m venv ~/.venvs/message_bot
2. Install dependencies
~/.venvs/message_bot/bin/pip install -r requirements.txt
3. Add your OpenAI API key
Copy .env.example to .env and fill in your key:
cp .env.example .env
Or, if you'd rather not use a .env file, export it in your shell (or add to ~/.zshrc):
export OPENAI_API_KEY="sk-..."
.env takes precedence over shell exports. Other knobs you can set in .env:
CUSTOM_DM_PROMPT / CUSTOM_GROUP_PROMPT — override the system prompts (use {name} as a placeholder).
MULTI_MESSAGE_WEIGHT — 0.0–1.0. 0.0 guarantees a single message, 1.0 guarantees multiple; values in between bias the model smoothly.
Defaults live in messaging.py.
4. Grant Full Disk Access
In System Settings → Privacy & Security → Full Disk Access , add your terminal (and Python if prompted) so the bot can read ~/Library/Messages/chat.db and the AddressBook databases.
Run
~/.venvs/message_bot/bin/python /Users/adityar/Downloads/iMessage-Bot/bot.py
Set AUTO_SEND = True in bot.py to skip the preview window and send immediately (note that this is highly dangerous and discouraged).
Files
bot.py — entry point / orchestration
db.py — SQLite reads from chat.db (DMs + group chats) and AddressBook
gui.py — tabbed picker (DMs / Group Chats) + reply preview
messaging.py — OpenAI reply generation + AppleScript send (DM and group)
.env.example — template for OPENAI_API_KEY, CUSTOM_DM_PROMPT, CUSTOM_GROUP_PROMPT, MULTI_MESSAGE_WEIGHT
About
AI that automatically crafts and sends replies to your contacts and group chats
Resources
Readme
Uh oh!
There was an error while loading. Please reload this page.
Activity
Stars
stars
Watchers
watching
Forks
forks
Report repository
Releases
No releases published
Packages
Uh oh!
There was an error while loading. Please reload this page.
Contributors
Uh oh!
There was an error while loading. Please reload this page.
Languages
Python<br>100.0%
You can’t perform that action at this time.