← back to Commercialrealestate

scripts/run-morning-report.sh

21 lines

#!/bin/zsh
# Daily SFV CRE Top-10 report -> emailed to steve-office + steve-personal (steveabramsdesigns@gmail.com) via George.
# Wired to launchd com.steve.cre-morning-report (06:00 America/Los_Angeles).
# Local + free: analyze.js re-ranks (Qwen local), morning-report.js builds the HTML; one George email out.
export PATH="/usr/local/bin:/opt/homebrew/bin:$HOME/.npm-global/bin:$HOME/.claude/local:$PATH"
cd "$HOME/Projects/commercialrealestate" || exit 1
LOG=/tmp/cre-morning-report.log
echo "===== run $(date) =====" >> "$LOG"

/opt/homebrew/bin/node scripts/analyze.js >> "$LOG" 2>&1
REPORT_DATE="$(date +%Y-%m-%d)" /opt/homebrew/bin/node scripts/morning-report.js > data/morning-report.html 2>> "$LOG"

TODAY="$(date +%Y-%m-%d)"
PROMPT="Read /Users/macstudio3/Projects/commercialrealestate/data/morning-report.html and send its FULL contents as the HTML body of an email using the mcp__george__gmail_send tool with account 'steve-office' to 'steve@designerwallcoverings.com, steveabramsdesigns@gmail.com'. Subject: 'SFV CRE - Top 10 Opportunities ($TODAY)'. Send the HTML exactly as-is; do not summarize, truncate, or modify it. Sending that one email is the ONLY action to take."

env -u ANTHROPIC_API_KEY -u ANTHROPIC_AUTH_TOKEN "$HOME/.npm-global/bin/claude" -p "$PROMPT" \
  --allowedTools "Read" "mcp__george__gmail_send" \
  --dangerously-skip-permissions >> "$LOG" 2>&1

echo "===== done $(date) =====" >> "$LOG"