feat: --watch mode — auto-regenerate llms.txt on file change - #82
Conversation
- Added `watch` extra with `watchfiles` dependency in `pyproject.toml`. - Implemented `iter_changes` in new `src/llmstxt_gen/watcher.py`. - Added `--watch` flag to `generate` command in `src/llmstxt_gen/cli.py`. - Implemented watch loop that reuses incremental cache for fast rebuilds. - Added comprehensive tests for watch mode in `tests/test_watcher.py`. - Ensured `--watch` and `--diff` are mutually exclusive. - Added clean SIGINT/KeyboardInterrupt handling. Co-authored-by: wuzzzzaah <1645504+wuzzzzaah@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- raise typer.Exit from None inside except KeyboardInterrupt (B904) - Remove unused imports in test_watcher.py: time, MagicMock, pytest (F401) - Remove unused TYPE_CHECKING import of FileChange in watcher.py (F401) - Use collections.abc.Iterator instead of typing.Iterator (UP035) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This PR introduces a
--watchflag to thegeneratecommand, allowingllmstxt-gento automatically rebuild thellms.txtfiles whenever a tracked source file is modified.Key changes:
watchfilesas an optional dependency under thewatchextra.src/llmstxt_gen/watcher.pyto provide a clean iterator over file changes.generatecommand to support a continuous loop when--watchis enabled. It uses the existing incremental caching logic to ensure rebuilds are fast.--watchwith--diffand handlesKeyboardInterruptto exit gracefully.[14:02:31] Rebuilt in 0.4s (3 files changed).Fixes #76
PR created automatically by Jules for task 8779591166687098691 started by @wuzzzzaah