email processor

This commit is contained in:
Yanxin Lu
2026-02-26 20:54:07 -08:00
parent c5c9be3f00
commit b14a93866e
18 changed files with 1365 additions and 666 deletions

View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bash
# email-processor — wrapper script for the email processor.
#
# Usage:
# ./email-processor.sh scan # classify unseen emails
# ./email-processor.sh scan --recent 30 # last 30 days
# ./email-processor.sh scan --dry-run # classify only, no changes
# ./email-processor.sh scan --recent 7 --dry-run # combine both
# ./email-processor.sh review list # show pending queue
# ./email-processor.sh review 1 delete # act on email #1
# ./email-processor.sh review all delete # act on all pending
# ./email-processor.sh review accept # accept all suggestions
# ./email-processor.sh stats # show history stats
# ./email-processor.sh migrate # import old decisions
#
# Requires: Python 3.8+, himalaya, Ollama running with model.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
# Activate the virtualenv if it exists
if [ -d "$SCRIPT_DIR/venv" ]; then
source "$SCRIPT_DIR/venv/bin/activate"
fi
exec python3 "$SCRIPT_DIR/main.py" "$@"