Morning Email Rollup
by @am-will
Daily morning rollup of important emails and calendar events at 8am with AI-generated summaries
clawhub install morning-email-rollupπ About This Skill
name: morning-email-rollup description: Daily morning rollup of important emails and calendar events at 8am with AI-generated summaries metadata: {"clawdbot":{"emoji":"π§","requires":{"bins":["gog","gemini","jq","date"]}}}
Morning Email Rollup
Automatically generates a daily summary of important emails and delivers it to Telegram at 8am Denver time.
Setup
Required: Set your Gmail account email:
export GOG_ACCOUNT="your-email@gmail.com"
Or edit the script directly to set the default.
What It Does
Usage
Manual Run
# Default (10 emails)
bash skills/morning-email-rollup/rollup.shCustom number of emails
MAX_EMAILS=20 bash skills/morning-email-rollup/rollup.sh
MAX_EMAILS=5 bash skills/morning-email-rollup/rollup.sh
View Log
cat $HOME/clawd/morning-email-rollup-log.md
How It Works
1. Checks calendar - Lists today's events from Google Calendar via gog
2. Searches Gmail - Query: is:important OR is:starred newer_than:1d
3. Fetches details - Gets sender, subject, date, and body for each email
4. AI Summarization - Uses Gemini CLI to generate natural language summaries
5. Formats output - Creates readable summary with read/unread markers
6. Sends to Telegram - Delivers via Clawdbot's messaging system
Calendar Integration
The script automatically includes today's calendar events from your Google Calendar using the same gog CLI that queries Gmail.
Graceful Fallback:
gog is not installed β Calendar section is silently skipped (no errors)Requirements:
gog must be installed and authenticatedGOG_ACCOUNT environment variable)Email Criteria
Emails are included if they match any of:
AI Summarization
Each email is summarized using the Gemini CLI (gemini):
gemini --model gemini-2.0-flash with a prompt to summarize in 1 sentenceImportant: The email body is passed as part of the prompt (not via stdin) because the gemini CLI doesn't handle piped input with prompts correctly.
Example output:
π΄ William Ryan: Invitation to team meeting
The email invites you to a team meeting tomorrow at 2pm to discuss the Q1 roadmap and assign tasks for the upcoming sprint.
Read/Unread Indicators
All emails show one of these markers for visual consistency.
Formatting Notes
Subject and Summary Cleanup:
""Agent Skills"" β Agent Skills)Cron Schedule
Set up a daily cron job at your preferred time:
cron add --name "Morning Email Rollup" \
--schedule "0 8 * * *" \
--tz "America/Denver" \
--session isolated \
--message "GOG_ACCOUNT=your-email@gmail.com bash /path/to/skills/morning-email-rollup/rollup.sh"
Adjust the time (8:00 AM) and timezone to your preference.
Customization
Change Number of Emails
By default, the rollup shows 10 emails. To change this:
Temporary (one-time):
MAX_EMAILS=20 bash skills/morning-email-rollup/rollup.sh
Permanent:
Edit skills/morning-email-rollup/rollup.sh:
MAX_EMAILS="${MAX_EMAILS:-20}" # Change 10 to your preferred number
Change Search Criteria
Edit skills/morning-email-rollup/rollup.sh:
# Current: important or starred from last 24h
IMPORTANT_EMAILS=$(gog gmail search 'is:important OR is:starred newer_than:1d' --max 20 ...)Examples of other searches:
Unread important emails only
IMPORTANT_EMAILS=$(gog gmail search 'is:important is:unread newer_than:1d' --max 20 ...)Specific senders
IMPORTANT_EMAILS=$(gog gmail search 'from:boss@company.com OR from:client@example.com newer_than:1d' --max 20 ...)By label/category
IMPORTANT_EMAILS=$(gog gmail search 'label:work is:important newer_than:1d' --max 20 ...)
Change Time
Update the cron schedule:
# List cron jobs to get the ID
cron listUpdate schedule (example: 7am instead of 8am)
cron update --schedule "0 7 * * *" --tz "America/Denver"
Change Summary Style
Edit the prompt in the summarize_email() function in rollup.sh:
# Current: medium-to-long 1 sentence
"Summarize this email in exactly 1 sentence of natural language. Make it medium to long length. Don't use quotes:"Shorter summaries
"Summarize in 1 short sentence:"More detail
"Summarize in 2-3 sentences with key details:"
Change AI Model
Edit the gemini command in summarize_email():
# Current: gemini-2.0-flash (fast)
gemini --model gemini-2.0-flash "Summarize..."Use a different model
gemini --model gemini-pro "Summarize..."
Troubleshooting
Not receiving rollups
# Check if cron job is enabled
cron listCheck last run status
cron runs Test manually
bash skills/morning-email-rollup/rollup.sh
Missing emails
gog gmail search 'is:important newer_than:1d'Summaries not appearing
gemini CLI is installed: which geminiecho "test" | gemini "Summarize this:"Wrong timezone
America/Denver (MST/MDT)cron update --tz "Your/Timezone" Log History
All rollup runs are logged to:
$HOME/clawd/morning-email-rollup-log.md
Format:
- [2026-01-15 08:00:00] π Starting morning email rollup
[2026-01-15 08:00:02] β
Rollup complete: 15 emails
π‘ Examples
Manual Run
# Default (10 emails)
bash skills/morning-email-rollup/rollup.shCustom number of emails
MAX_EMAILS=20 bash skills/morning-email-rollup/rollup.sh
MAX_EMAILS=5 bash skills/morning-email-rollup/rollup.sh
View Log
cat $HOME/clawd/morning-email-rollup-log.md
βοΈ Configuration
Required: Set your Gmail account email:
export GOG_ACCOUNT="your-email@gmail.com"
Or edit the script directly to set the default.
π Tips & Best Practices
Not receiving rollups
# Check if cron job is enabled
cron listCheck last run status
cron runs Test manually
bash skills/morning-email-rollup/rollup.sh
Missing emails
gog gmail search 'is:important newer_than:1d'Summaries not appearing
gemini CLI is installed: which geminiecho "test" | gemini "Summarize this:"Wrong timezone
America/Denver (MST/MDT)cron update --tz "Your/Timezone"