Skip to content

Commit 41dd679

Browse files
committed
docs: document daemon mode for automatic file re-indexing
Add daemon mode documentation to README.md and CHANGELOG.md: - Feature bullet point in "What you get" section - Complete usage section with CLI commands and examples - CHANGELOG entry with all daemon mode capabilities
1 parent 82dccfa commit 41dd679

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
#### **Daemon Mode for Automatic Re-Indexing**
13+
- **Background file watching**: `codegraph daemon start <path>` launches a background process that monitors file changes
14+
- **Automatic re-indexing**: Changed files are automatically re-indexed using upsert semantics (no duplicates)
15+
- **Circuit breaker pattern**: SurrealDB health monitoring with exponential backoff for resilience
16+
- **PID file management**: Proper daemon lifecycle with process tracking and graceful shutdown
17+
- **CLI commands**:
18+
- `codegraph daemon start <path>` - Start watching a project (with `--foreground` option for debugging)
19+
- `codegraph daemon stop <path>` - Stop the daemon for a project
20+
- `codegraph daemon status <path>` - Check daemon status (with `--json` option)
21+
- **Language and pattern filtering**: Supports `--languages`, `--exclude`, and `--include` flags
22+
- **Event coalescing**: Batches rapid file changes to avoid redundant re-indexing
23+
- **Feature flag**: `daemon` feature enables this functionality
24+
1025
### Removed
1126
- Dropped the transactional/versioning/branch N-API bindings plus their documentation; the native TypeScript surface now focuses on semantic search, graph analysis, and cloud configuration so it matches the Surreal-only architecture.
1227
- Replaced the native addon example with a semantic-search walkthrough and removed CLI-centric integration snippets that referenced the deleted CodeGraph CLI.

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ CodeGraph indexes your source code to a graph database, creates semantic embeddi
1717
- 📦 **NEW:** Node.js NAPI bindings for zero-overhead TypeScript integration
1818
- 🤖 **NEW:** Agentic code-agent tools with tier-aware multi-step reasoning
1919
- 🔄 **NEW:** Incremental indexing with SHA-256 file change detection—only re-index modified files
20+
- 👁️ **NEW:** Daemon mode for automatic file watching and re-indexing on changes
2021
- 🔬 **EXPERIMENTAL:** AutoAgents framework integration for improved agent orchestration
2122

2223
### Local Embeddings & Reranking (SurrealDB)
@@ -547,6 +548,42 @@ codegraph start stdio
547548
codegraph tools list
548549
```
549550

551+
### Daemon Mode (Automatic Re-Indexing)
552+
553+
Keep your index up-to-date automatically by running the daemon:
554+
555+
```bash
556+
# Start watching a project (runs in background)
557+
codegraph daemon start /path/to/project
558+
559+
# Start in foreground for debugging
560+
codegraph daemon start /path/to/project --foreground
561+
562+
# Filter by languages
563+
codegraph daemon start /path/to/project --languages rust,typescript
564+
565+
# Exclude patterns
566+
codegraph daemon start /path/to/project --exclude "**/node_modules/**" --exclude "**/target/**"
567+
568+
# Check daemon status
569+
codegraph daemon status /path/to/project
570+
codegraph daemon status /path/to/project --json # JSON output
571+
572+
# Stop the daemon
573+
codegraph daemon stop /path/to/project
574+
```
575+
576+
**Features:**
577+
- 🔄 Automatic re-indexing when files change (create, modify, delete, rename)
578+
- ⚡ Event coalescing to batch rapid changes
579+
- 🛡️ Circuit breaker pattern for SurrealDB resilience
580+
- 📊 Session metrics tracking (batches processed, errors, etc.)
581+
582+
**Note:** Requires the `daemon` feature flag:
583+
```bash
584+
cargo build --release -p codegraph-mcp --features "daemon,ai-enhanced,ollama"
585+
```
586+
550587
**Note:** HTTP transport is not yet implemented with the official rmcp SDK. Use STDIO transport for all MCP integrations.
551588

552589
### Using with Claude Desktop

0 commit comments

Comments
 (0)