-
Clone the repository and navigate to the project directory.
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
Create a
.envfile in the project root with the following variables:SUPABASE_ACCESS_TOKEN=your_supabase_access_token TELEGRAM_BOT_TOKEN=your_telegram_bot_token TELEGRAM_CHAT_ID=your_telegram_chat_id -
Run the script:
python main.py
The script will run continuously, executing the main task every morning at 6:00 AM.
-
Change Schedule:
To run at a different time, modify thehourandminuteinscheduler.add_jobinmain.py. -
Change Telegram Message Format:
Edit the formatting logic in the CrewAI task description or in thesend_telegram_messagefunction.
- At the scheduled time, the script:
- Connects to Supabase using the MCP server.
- Retrieves the last 5 records from the
habitstable. - Summarizes the habits and selects a quote from "Atomic Habits".
- Sends the formatted summary to the configured Telegram chat.
- Python 3.12+
- Node.js (for MCP server)
- Supabase account and access token
- Telegram bot and chat ID