Text Plans to Calendar: local AI turns texted plans into calendar events
$9
Plans made over text ("tacos thursday at 7:30?" / "perfect, see you then") rarely make it onto the calendar. Text Plans to Calendar watches for new messages on your Mac, asks a local AI model...
Read full descriptionDescription
Plans made over text ("tacos thursday at 7:30?" / "perfect, see you then") rarely make it onto the calendar. Text Plans to Calendar watches for new messages on your Mac, asks a local AI model (Ollama, default qwen3:4b) whether a conversation contains a plan that both sides agreed to, and adds it to your Google Calendar as a tentative event you can confirm or delete.
Who it's for: Mac users who text plans with friends, family, or teammates and want them on the calendar without pasting conversations into a cloud chatbot.
Features
- Local AI: message text goes only to Ollama on your own Mac. No API key, no per-message cost.
- Safety checks before anything is added:
- the plan must be agreed by both sides, and you must have sent a message in the chat
- the confirming message must be new since the last run
- the date and start time are checked against the words in the chat ("tomorrow", "thursday", "7pm", "at 7", "noon") and corrected to them, so a small model can't move a plan to the wrong day or hour
- event titles must use words from the chat
- tapback reactions and short-code senders are ignored
- text inside messages is treated as data, not instructions (prompt-injection guard)
- no more than 3 new events per run
- Insert-only: it never changes or deletes an existing event. A cancelled plan gets a note instead.
- The first run starts from your newest message, so old history is never scanned.
- Uses your own Google Cloud OAuth client and asks only for the calendar events permission.
- Calendar, event color, model, and Ollama URL are all set in one config file.
- Optional Discord notification for each added event.
- Includes
run --dry-run, acheckcommand for setup problems, and a launchd template that runs it every 10 minutes. - About 850 lines of readable Python, 3 dependencies, and a fully mocked pytest suite (39 tests).
Requirements
- macOS with Messages signed in. Android SMS only appears if Text Message Forwarding is on in your iPhone's settings.
- Full Disk Access for the Python that runs it, since macOS protects the Messages database.
- Python 3.9 or newer.
- Ollama with qwen3:4b, which needs about 3 GB of free RAM. An 8 GB Apple silicon Mac works.
- A Google account and a free Google Cloud project for your own OAuth client. The README walks you through it.
Setup overview
Install three Python packages and pull the model, create a Desktop OAuth client in Google Cloud, copy the example config, grant Full Disk Access, sign in once, test with a dry run, and load the included launchd job. Allow about 20 minutes.
Privacy
The tool reads your Messages database on your Mac (read-only), and message text and contact names go only to the Ollama server set in ollama_url. That is your own Mac by default, so keep it on localhost for full privacy. Only the final event leaves your Mac. It goes to your own Google Calendar and includes the title, date and time, location, contact name, and by default the one confirming message quoted in the description, which you can turn off. If you add a Discord webhook, the same short summary goes to Discord. No telemetry. The seller receives nothing.
Disclaimer
Provided as is, without warranty. A small local model will sometimes miss a plan, misread a plan, or add an event that isn't real. That's why events are added as tentative: check them before you rely on them. Not affiliated with or endorsed by Apple or Google. iMessage and macOS are trademarks of Apple Inc. Google Calendar is a trademark of Google LLC.
Files included
text-plans-calendartext-plans-calendar
teststests
- test_text_plans.pytest_text_plans.py22.4 KB
- conftest.pyconftest.py98 B
text_plans_calendartext_plans_calendar
- guards.pyguards.py11 KB
- runner.pyrunner.py7.4 KB
- messages.pymessages.py5.4 KB
- llm.pyllm.py4.5 KB
- gcal.pygcal.py3.7 KB
- __main__.py__main__.py2.8 KB
- config.pyconfig.py2.1 KB
- notify.pynotify.py572 B
- __init__.py__init__.py187 B
- README.mdREADME.md10.1 KB
launchdlaunchd
- local.text-plans-calendar.plistlocal.text-plans-calendar.plist1.2 KB
- CHANGELOG.mdCHANGELOG.md908 B
- config.example.jsonconfig.example.json266 B
- requirements.txtrequirements.txt59 B
- .gitignore.gitignore46 B
README
text-plans-calendar/README.md
Text Plans to Calendar
Turns plans you make over text ("dinner friday at 7?" / "yes!") into tentative Google Calendar events, using an AI model that runs on your own Mac through Ollama.
- Private: your message text is read from the Messages database on your Mac and sent only to your local Ollama. It never goes to OpenAI, Anthropic, or any other cloud AI. There is no API key and no per-message cost.
- Careful: a plan is only added when both sides agreed, you took part in the chat, and the message that confirms it is new. A day like "tomorrow" is checked against the day the message was sent, so an old "see you tomorrow" can't be re-dated. Questions, maybes, jokes, and cancelled plans are skipped.
- Insert-only: it adds tentative events and never changes or deletes anything already on your calendar. If a plan gets cancelled, it sends you a note (optional Discord) and leaves the event for you to delete.
- Small: about 850 lines of readable Python, three dependencies, and a fully mocked test suite.
What leaves your Mac
| Data | Where it goes |
|---|---|
| Message text, contact names, phone numbers | Only to ollama_url, which is your own Mac by default |
| Event title, date/time, location, the contact's name, and the one confirming message (quoted in the event description; can be turned off) | Google Calendar (your own account) |
| The same event summary | Discord, only if you set discord_webhook_url |
Keep ollama_url pointed at localhost if you want message text to stay on your Mac. Set
quote_message_in_event to false if you don't want the confirming message quoted in the event
or the Discord note (it's on by default so you can see why an event was added).
Requirements
- macOS with the Messages app signed in (iMessage). SMS from Android phones only appears on a Mac if your iPhone has Settings → Messages → Text Message Forwarding turned on for this Mac.
- Full Disk Access for the Python that runs it (macOS protects the Messages database).
- Python 3.9 or newer.
- Ollama with
qwen3:4b(about 3 GB of free RAM; an 8 GB Apple silicon Mac is fine). - A Google account and a free Google Cloud project for your own OAuth client (step 2).
Setup (about 20 minutes)
1. Install
cd text-plans-calendar
python3 -m pip install -r requirements.txt
ollama pull qwen3:4b2. Create your own Google Calendar OAuth client (one time; Google requires your own)
- Go to https://console.cloud.google.com/ and create a project.
- Open APIs & Services → Library, search for Google Calendar API, and click Enable.
- Open the OAuth consent screen (shown as Google Auth Platform in newer consoles). Choose External, fill in an app name and your email, and under Audience / Test users add your own Google address.
- Open Credentials → Create credentials → OAuth client ID, choose Desktop app, and click Download JSON.
- Save the file as
~/.config/text-plans-calendar/credentials.json.
The app only asks for the calendar.events permission (add and view events). It never asks for
your Gmail, Drive, or contacts.
3. Configure
cp config.example.json config.json| Key | What it does |
|---|---|
my_name | Your first name, so the model knows who "Me" is. Optional. |
model | Any Ollama model. Default qwen3:4b. |
ollama_url | Default http://localhost:11434/api/chat. Keep it local for privacy. |
calendar_id | primary, or a calendar's ID from Google Calendar → Settings → calendar → Integrate calendar. |
event_color_id | null for the calendar's color, or "1"–"11": 1 Lavender, 2 Sage, 3 Grape, 4 Flamingo, 5 Banana, 6 Tangerine, 7 Peacock, 8 Graphite, 9 Blueberry, 10 Basil, 11 Tomato. |
default_duration_hours | Length of an event when no end time was agreed. |
max_new_events_per_run | Safety cap (default 3). Extra plans wait for the next run. |
use_contacts | Show contact names to the model instead of phone numbers. |
quote_message_in_event | Quote the confirming message in the event description and Discord note. Default true. |
discord_webhook_url | Optional Discord webhook for "added" and "may be cancelled" notes. Or set the TPC_DISCORD_WEBHOOK_URL environment variable. |
Advanced keys with defaults: max_days_ahead (60), context_hours (72), context_max_messages
(25), same_slot_minutes (30), ollama_num_ctx (4096), ollama_timeout_seconds (150),
chat_db, state_file, credentials_file, token_file.
4. Give Full Disk Access
macOS blocks every app from reading Messages unless you allow it.
To run it by hand from Terminal: System Settings → Privacy & Security → Full Disk Access, turn on Terminal (or iTerm, etc.), then quit and reopen it.
To run it in the background (launchd), the Python itself needs access. Print its real path:
Shellpython3 -c "import os, sys; print(os.path.realpath(sys.executable))"In the Full Disk Access list click +, press Cmd+Shift+G, paste that path, and add it.
5. Sign in to Google and check everything
python3 -m text_plans_calendar auth # opens a browser once
python3 -m text_plans_calendar check # Messages access, Ollama, Google sign-inGoogle will say the app isn't verified. That's expected for your own client: choose Advanced → Go to (your app). The token is saved with owner-only permissions.
6. Try it without changing anything
python3 -m text_plans_calendar run --dry-run --since-hours 48This prints what it would add from the last 48 hours. Nothing is written to your calendar, the state file, or Discord.
7. Start it for real
python3 -m text_plans_calendar runThe first real run only remembers where your messages end. Your old history is never scanned; from then on each run looks only at messages that arrived since the last one.
Run it automatically (launchd)
Copy
launchd/local.text-plans-calendar.plistto~/Library/LaunchAgents/.Edit it and replace each
/ABSOLUTE/PATH/TO/...placeholder: the Python path from step 4, and the full path of this folder. launchd does not expand~.Load it:
Shelllaunchctl load ~/Library/LaunchAgents/local.text-plans-calendar.plist
It runs every 10 minutes and logs to text-plans.log in this folder. To stop it, use
launchctl unload with the same path.
How it decides
Each run:
- Reads messages newer than the last run (read-only).
- Skips chats unless a new message mentions a day or time, and skips 5–6 digit short-code senders (banks, codes, appointment bots).
- Sends the last 72 hours of that chat to the local model, with new lines marked
[NEW]and the conversation wrapped as untrusted data. Instructions written inside messages are ignored. - Checks every answer before anything touches your calendar:
- status must be agreed, and the date must be today through 60 days out;
- you must have sent at least one message in the chat;
- the quoted evidence must be one of the new messages, not an old one;
- the date must match "tomorrow", "tonight", or a weekday written in that message (or, for a reply like "sounds good", in the message it answers), counted from the day it was sent. If the model picked another day and the wording names one clear day, the date is corrected to it; if the wording is ambiguous ("next friday", "tomorrow" sent after midnight), the plan is skipped;
- the start time must match a clock time written in the chat ("7pm", "at 7", "6:30", "noon"). A bare "7" or "6:30" counts as PM for dinners, drinks, and anything at 1-6 o'clock, and AM for breakfast or morning plans. A wrong time is corrected to the written one, a time the model made up when none was written is dropped (all-day event), and several conflicting times ("7 or 8?") are skipped unless the model picked one of them;
- title words must come from the chat or the contact's name, otherwise the title becomes "Plans with name";
- the same evidence or the same time slot (within 30 minutes) is never added twice;
- tapback reactions (Liked "…") are ignored, since they quote older messages.
- Adds at most 3 tentative events per run. If a model or calendar call fails, the run exits with code 1 and the same messages are retried next time.
Troubleshooting
can't read the Messages database: Full Disk Access is missing for the program running it (step 4). After granting it, restart Terminal or reload the launchd job.Ollama not reachable: open the Ollama app or runollama serve.not signed in to Google yet: runpython3 -m text_plans_calendar auth.- Sign-in stops working after about 7 days: Google expires tokens for apps whose consent
screen is in Testing. Rerun
auth, or set the app's publishing status to In production in the console (for your own use you don't need Google's verification; you'll just see the "unverified app" screen once). - A plan wasn't added, or was corrected: run with
--dry-run --since-hours 24and read the log; every skipped, rejected, or corrected plan is logged with the reason. - Android friends' texts are missing: turn on Text Message Forwarding (see Requirements).
Tests
python3 -m pip install pytest
python3 -m pytest testsThe tests build a fake Messages database and stub the model, Google, and Discord. They make no network calls.
Disclaimer
This software is provided "as is", without warranty of any kind. A small AI model will sometimes miss a plan, misread a time, or add an event that isn't real. Events are added as tentative so you can confirm or delete them; check them before relying on them. You run it with your own Google credentials and are responsible for how it is used on your account and with other people's messages. The author is not liable for missed, wrong, or duplicate events or any resulting loss.
Not affiliated with or endorsed by Apple or Google. iMessage and macOS are trademarks of Apple Inc.; Google Calendar is a trademark of Google LLC.
Reviews
No reviews