@@ -489,6 +489,65 @@ Once configured, Claude Code can use these tools automatically. You can prompt:
489489| Empty search results | Ensure docs directory has ` .md ` files |
490490| Slow searches | Run ` aidocs rag ` to pre-chunk files |
491491
492+ ### ` aidocs watch `
493+
494+ Watch documentation directory for changes and automatically re-chunk files and regenerate embeddings.
495+
496+ ``` bash
497+ aidocs watch # Watch docs/ with auto-embeddings
498+ aidocs watch --with-vectors # Generate also embeddings
499+ aidocs watch --debounce 5 # Wait 5 seconds before processing
500+ aidocs watch docs/users # Watch specific subdirectory
501+ ```
502+
503+ ** Options:**
504+ | Option | Description |
505+ | --------| -------------|
506+ | ` --with-vectors ` | Include embedding generation |
507+ | ` --debounce, -d ` | Seconds to wait after last change (default: 10) |
508+ | ` --table, -t ` | Target table name for embeddings (default: ` doc_embeddings ` ) |
509+
510+ ** What it does:**
511+ 1 . Monitors the docs directory for ` .md ` file changes
512+ 2 . Debounces rapid changes (waits 10 seconds after last edit by default)
513+ 3 . Re-chunks modified files automatically
514+ 4 . Generates embeddings if ` OPENAI_API_KEY ` is set (use ` --with-vectors ` to enable)
515+ 5 . Updates manifest and sync state
516+
517+ ** Real-time display:**
518+ ```
519+ ╭─────────────────────────────────────────╮
520+ │ Watching docs/ │
521+ │ │
522+ │ Last update: 14:32:05 │
523+ │ Files: 12 | Chunks: 45 | Embeddings: 45 │
524+ │ │
525+ │ Embeddings: enabled │
526+ │ │
527+ │ Recent: │
528+ │ ✓ users/index.md (3 chunks) │
529+ │ ✓ api/auth.md (5 chunks) │
530+ │ │
531+ │ Press Ctrl+C to stop │
532+ ╰─────────────────────────────────────────╯
533+ ```
534+
535+ ** Use cases:**
536+ - Keep chunks updated while editing documentation
537+ - Auto-sync embeddings during documentation sprints
538+ - Run alongside ` aidocs serve ` for a complete dev workflow
539+
540+ ** Example workflow:**
541+ ``` bash
542+ # Terminal 1: Watch for changes
543+ aidocs watch
544+
545+ # Terminal 2: Serve documentation
546+ aidocs serve
547+
548+ # Edit docs in your editor - changes auto-sync!
549+ ```
550+
492551## Slash Commands
493552
494553After running ` aidocs init ` , these commands are available in Claude Code:
0 commit comments