Skip to content

feat: add daily auto-trigger with --schedule and --watch modes#2

Open
4444J99 wants to merge 2 commits intom13v:mainfrom
4444J99:feat/daily-auto-trigger
Open

feat: add daily auto-trigger with --schedule and --watch modes#2
4444J99 wants to merge 2 commits intom13v:mainfrom
4444J99:feat/daily-auto-trigger

Conversation

@4444J99
Copy link

@4444J99 4444J99 commented Mar 23, 2026

Summary

Adds the #1 priority feature from the README TODO list: auto-triggered daily summaries.

Three new CLI flags:

  • --schedule — generates a macOS LaunchAgent plist or crontab entry (copy-paste install)
  • --watch — foreground daemon that wakes at the configured time and runs summarization
  • --time HH:MM — configurable schedule time (default: 09:00)

Usage

# Generate scheduling config (LaunchAgent on macOS, crontab on Linux)
cargo run -- /path/to/repo "git log --oneline -20" --schedule

# Run as foreground daemon (wakes daily at 9am)
cargo run -- /path/to/repo "git log --oneline -20" --watch

# Custom time
cargo run -- /path/to/repo "git log --oneline -20" --watch --time 17:30

Implementation

  • Extracted run_summarize() from main() so both one-shot and watch modes share identical behavior
  • --schedule: detects OS, generates appropriate config with correct binary path
  • --watch: uses tokio::time::sleep to compute seconds until next occurrence, runs, then sleeps past the minute boundary to avoid re-trigger
  • --help / -h: full usage docs
  • Backward compatible — positional args work identically to before

Dependencies

  • Added dirs = "5.0" for home directory resolution in LaunchAgent path generation

cargo check passes clean.

TODO Items Addressed

4444J99 and others added 2 commits March 23, 2026 12:35
Summaries are now saved to data/summaries/YYYY-MM-DD/summary-HHMMSS.md
in addition to the root git_commit_summaries.md (backward compatible).
Each run produces a timestamped file, building a history of daily
summaries that supports the planned auto-trigger feature.

Adds chrono dependency for date formatting.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds three new CLI flags for automated daily summarization:

- --schedule: generates platform-specific scheduling config
  (macOS LaunchAgent plist or crontab entry)
- --watch: foreground daemon using tokio sleep, wakes at
  the configured time each day
- --time HH:MM: configurable schedule time (default 09:00)
- --help: usage documentation

Extracts core summarization into run_summarize() so both
one-shot and watch modes share identical logic. Existing
positional-arg CLI behavior is fully preserved.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant