This project provides a simple way to create macOS Calendar events from selected text using AI. It uses litellm to process the text and extract event details, then uses AppleScript to add them to your calendar.
- Context Aware: Understands dates like "tomorrow", "next Friday", etc.
- Smart Extraction: Extracts summary, start/end time, location, and description.
- Reminders: Automatically adds an alert/reminder before the event.
- macOS Integration: Designed to work as a Quick Action (Services menu) via Automator.
- macOS
- Python 3 installed
- An API Key for a supported LLM (OpenAI, Anthropic, Gemini, etc.)
-
Clone or Download this repository: Save the files to a directory, e.g.,
~/pjts/text2agenda. -
Set up Python Virtual Environment: Open a terminal, navigate to the project directory, and run:
cd ~/pjts/text2agenda python3 -m venv venv source venv/bin/activate pip install -r requirements.txt
-
Configuration: Open
config.jsonand update the following:api_key: Your actual API Key.model: The model you want to use (e.g.,gpt-4o,gemini-1.5-flash, etc.). See litellm docs for model names.calendar_name: The exact name of the calendar in your macOS Calendar app where you want events to be added (default is usually "Calendar" or "Home").reminder_minutes: How many minutes before the event to set the alert.
-
Make script executable:
chmod +x run_remind.sh
To use this from the right-click menu (Services):
- Open Automator on your Mac.
- Choose New Document -> Quick Action.
- Configure the settings at the top:
- Workflow receives current text in any application.
- Add a Run Shell Script action from the library.
- In the script box:
- Set "Shell" to
/bin/bash. - Set "Pass input" to as arguments.
- Paste the following code (update the path to match your actual directory):
/PATH/TO/text2agenda/run_remind.sh "$1"
- Set "Shell" to
- Save the Quick Action (e.g., name it "Add to Calendar").
- Select any text containing event info (e.g., inside an email or webpage).
- Right-click (or Control-click) the selection.
- Go to Services -> Add to Calendar (or whatever you named it).
- Check your Calendar app!
If it doesn't work, check the log file:
cat /tmp/remind_log.txt