You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DEVELOPER_GUIDE.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -148,6 +148,8 @@ Scoped `--files` / `--commits` refreshes reuse the same path filter as full scan
148
148
149
149
Incremental refreshes that mutate `fts_chunks` increment `codeindex_meta.fts_incremental_writes_since_optimize`. When the counter reaches `DbWriter.DefaultFtsOptimizeIncrementalWriteThreshold`, the update path runs `INSERT INTO fts_chunks(fts_chunks) VALUES('optimize')`, resets the counter, and stamps `fts_last_optimized_at`. Users can run the same maintenance directly with `cdidx optimize --db <path>` or `cdidx index <projectPath> --optimize`; this may briefly hold the writer lock on large indexes.
150
150
151
+
Successful writer sessions attempt `PRAGMA wal_checkpoint(TRUNCATE)` before closing a writable `DbContext`, so large WAL files are reclaimed after index, backfill, optimize, prune, and other DB-writing commands. `cdidx db schema [--json]` dumps `sqlite_master` entries plus `PRAGMA user_version` for schema inspection, and `cdidx db prune --dry-run|--apply [--json]` counts or deletes orphaned `symbol_references`, `reference_lines`, and `symbols` rows before running `PRAGMA optimize` on apply.
152
+
151
153
### Extending the indexer
152
154
153
155
Out-of-tree post-extraction hooks can implement `CodeIndex.Indexer.Hooks.IPostExtractionHook` in a `.dll` placed under `~/.config/cdidx/hooks/` (or the directory named by `CDIDX_HOOKS_DIR`). Hook assemblies are discovered in path order. Each concrete hook type is instantiated with a public parameterless constructor, then called after built-in symbol extraction and again after built-in reference extraction, before rows are persisted. Hooks receive a `FileContext` plus mutable `IList<SymbolRecord>` / `IList<ReferenceRecord>` values, so they can annotate extracted records, add synthetic symbols, or add domain-specific references.
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,7 +84,7 @@ Output controls:
84
84
| ASCII-only terminal output | Use `--ascii`, `CDIDX_ASCII=1`, `NO_UNICODE`, `TERM=dumb`, accessibility env hints, or a non-UTF-8 locale. Spinners use pipe, slash, dash, and backslash frames; progress bars use `#` / `-`; very narrow terminals fall back to percentage-only progress. |
85
85
| Color and terminal capability |`--color auto` emits ANSI only for capable interactive terminals; `TERM=dumb`, `CI=true`, missing Unix terminal hints, `NO_COLOR`, or `CLICOLOR=0` disable ANSI/progress control sequences. `--palette basic|256|truecolor` can override the `COLORTERM` / `TERM` color-depth detection. |
86
86
| UTF-8 JSON pipelines | CLI `--json` output is written as UTF-8 without a BOM and never includes ANSI escape sequences, even when color is forced for human output. |
87
-
| Script-friendly query pipelines | Use `--quiet`, `-q`, `--silent`, or `CDIDX_QUIET=1` to suppress informational stderr text while preserving errors. `--quiet` takes precedence over `--verbose`. |
87
+
| Script-friendly query pipelines | Use `--quiet`, `-q`, `--silent`, or `CDIDX_QUIET=1` to suppress informational stderr text while preserving errors. `--quiet` takes precedence over `--verbose`. Read commands that support `--format` can emit `count`, `compact`, `csv`, or `tsv` output when callers need smaller or table-shaped payloads instead of full excerpts. |
88
88
89
89
Use `cdidx` when a repository will be searched repeatedly from terminals,
90
90
scripts, CI, or AI tools. Use `rg` when you only need a one-off text scan.
@@ -112,7 +112,7 @@ See [DISTRIBUTION.md](DISTRIBUTION.md) for the full channel matrix and
to report indexed file issues such as replacement characters (`U+FFFD`), BOMs,
117
117
NUL bytes, mixed line endings, UTF-16 BOMs, and likely non-UTF8 content.
118
118
Validation findings are reported in the output and do not by themselves make
@@ -133,7 +133,7 @@ downgrading `cdidx`.
133
133
134
134
| Area | What cdidx provides |
135
135
|---|---|
136
-
| Search surfaces | CLI-first output for humans and machines; full-text, symbol, reference, caller/callee, dependency, map, inspect, and excerpt commands. |
136
+
| Search surfaces | CLI-first output for humans and machines; full-text, symbol, reference, caller/callee, dependency, map, inspect, and excerpt commands. `search`, `definition`, `references`, `callers`, `callees`, `find`, and `validate` support `--format count|compact|csv|tsv|lsp|qf|sarif` for token-budgeted agents, scripts, editors, and CI reports. |
137
137
| Ranking and filters | Public/exported symbol matches rank ahead of protected, internal, and private matches. Use `--no-visibility-rank` for legacy order, and `--visibility` / `--exclude-visibility` with `symbols`, `definition`, `unused`, and `hotspots`. Query defaults can be adjusted with `CDIDX_DEFAULT_LIMIT`, `CDIDX_DEFAULT_SNIPPET_LINES`, and `CDIDX_DEFAULT_MAX_LINE_WIDTH`; explicit CLI flags still win. |
138
138
| Project scoping |`.sln` / `.csproj`-aware <code>--project <name|path></code> filters for indexing and queries, plus `--solution <path>` when a workspace has multiple solution files. |
139
139
| MCP integration | MCP server support for AI clients such as Claude Code, Cursor, and Windsurf, including tools, indexed-file resources, starter prompts, schema constraints for local argument validation, `mimeType` on text content blocks, logging, a structured `ping` health result, HTTP `GET /healthz`, opt-in HTTP `/events` keep-alive notifications, a compatibility server-side `notifications/initialized` ready signal on stdio or HTTP `/events` streams, and `Language support:` descriptions sourced from the same registries as `cdidx languages`. Tool schemas reject unknown arguments with `-32602`, advertise `x-stability`, and use snake_case structured JSON keys to match the CLI JSON contract. |
-**Time-sensitive CLI and MCP paths now use injectable clocks (#1617)** — status age calculations, query trace/log naming, MCP ping timestamps, and MCP suggestion persistence can now be driven by `TimeProvider` for deterministic tests.
-**Suggestion `CreatedAt` is now stamped at persistence time (#1618)** — new suggestions receive their creation timestamp inside the store's locked write path, aligning the recorded time with when the suggestion enters the local store.
13
+
14
+
## 日本語
15
+
16
+
-**suggestion の `CreatedAt` を永続化時に記録するようになりました (#1618)** — 新規 suggestion の作成時刻は store のロックされた書き込み経路内で付与され、ローカル store に入った時刻と一致するようになりました。
-**Read commands now support lightweight `count` and `compact` output formats (#1642)** — CLI `search`, `definition`, `references`, `callers`, `callees`, `find`, and `validate` can return count-only or file/line-only payloads through `--format`, while MCP search/definition/reference/caller/callee tools accept `format: "count"` or `format: "compact"` without emitting excerpts or full result metadata.
-**Successful writer sessions now truncate-checkpoint the SQLite WAL (#1644)** — writable DB contexts attempt `PRAGMA wal_checkpoint(TRUNCATE)` after write work so large `codeindex.db-wal` sidecars are reclaimed after successful maintenance and index runs.
-**Added `cdidx db schema` for on-disk schema inspection (#1646)** — the new command prints SQLite schema entries and `PRAGMA user_version`, with `--json` for automation.
-**Added `cdidx db prune --dry-run|--apply` for stale DB rows (#1728)** — the command counts or deletes orphaned `symbol_references`, `reference_lines`, and `symbols` rows, then runs `PRAGMA optimize` after apply.
14
+
15
+
## 日本語
16
+
17
+
-**stale DB rows を処理する `cdidx db prune --dry-run|--apply` を追加しました (#1728)** — このコマンドは orphaned `symbol_references`、`reference_lines`、`symbols` rows を集計または削除し、apply 後に `PRAGMA optimize` を実行します。
-**Built-in CSV and TSV query formatters are now available (#1941)** — formatter-aware read commands accept `--format csv` and `--format tsv`, giving scripts and CI jobs table-shaped output without reserializing JSON.
-**Time-dependent tests now use an explicit test clock (#2034)** — MCP timestamp and suggestion lifecycle coverage use `ManualTimeProvider` instead of depending on wall-clock time or hardcoded fixture dates.
0 commit comments