Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions USER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ sections below show examples and option details for the most common workflows.
| Analysis | `hotspots` | Rank high-impact symbols or statements by reference volume | `symbol_hotspots` |
| Analysis | `validate` | Report encoding and line-ending issues in indexed files; U+FFFD rows include origin/severity metadata | `validate` |
| Status | `status` | Show DB statistics, freshness, and readiness metadata | `status` |
| Status | `languages` | List language extensions and symbol/graph capabilities | `languages` |
| Status | `languages` | List language extensions and symbol/graph capabilities; add `--indexed-only` and `--capability graph|symbols|references` for workspace audits | `languages` |
| Diagnostics | `db --integrity-check` | Run SQLite `PRAGMA integrity_check` against the DB | -- |
| Diagnostics | `report --output <path>` | Build a redacted bug-report bundle | -- |
| Feedback | `suggestions` | List, inspect, and export local suggestion history | -- |
Expand Down Expand Up @@ -1531,7 +1531,7 @@ The database reflects the working tree at the time of the last index. After swit

## Supported languages

All indexed languages are searchable through FTS5. Rows with **Symbols = yes** also support structured queries by function, class, import, or language-specific symbol name.
All indexed languages are searchable through FTS5. Rows with **Symbols = yes** also support structured queries by function, class, import, or language-specific symbol name. Use `cdidx languages --indexed-only --json` to list only languages present in the current DB, and add `--capability graph|symbols|references` to narrow the table to languages that support a specific structured capability.

| Language | Extensions | Symbols |
|---|---|:---:|
Expand Down Expand Up @@ -1627,9 +1627,11 @@ All indexed languages are searchable through FTS5. Rows with **Symbols = yes** a

### Language extraction matrix

Use `cdidx languages --json` as the live capability probe. This matrix explains
the common extraction behavior so users know when to trust structured commands
and when to fall back to `search`.
Use `cdidx languages --json` as the live capability probe. Add `--indexed-only`
when you only want languages present in the current DB, and add
`--capability graph|symbols|references` when auditing a specific structured
capability. This matrix explains the common extraction behavior so users know
when to trust structured commands and when to fall back to `search`.

| Language family | Symbols | References / graph | Notes and example query |
|---|---|---|---|
Expand Down Expand Up @@ -3820,7 +3822,9 @@ indexing はファイル単位の SQLite transaction を commit します。長
### 言語別 extraction matrix

現在の capability は `cdidx languages --json` を live probe として確認してください。
この matrix は、構造化 command を信頼できる場面と `search` に戻るべき場面を判断するための概要です。
現在の DB に存在する言語だけを見たい場合は `--indexed-only`、特定の構造化 capability を監査する場合は
`--capability graph|symbols|references` を追加します。この matrix は、構造化 command を信頼できる場面と
`search` に戻るべき場面を判断するための概要です。

| 言語ファミリ | Symbols | References / graph | メモと例 |
|---|---|---|---|
Expand Down Expand Up @@ -4198,7 +4202,7 @@ OpenAI Codex CLI (`codex.json` または `~/.codex/config.json`):
| `symbol_hotspots` | 影響の大きい hotspot を検索。`groupBy` は `symbol` / `file` / `statement` を指定でき、SQL scope は statement grouping、非 SQL scope は symbol grouping が既定。 |
| `batch_query` | 複数クエリを1回で実行(MCP専用、最大10件)。レスポンスにはトップレベル `metadata`(`submitted` / `executed` / `errors` / `total_elapsed_ms` / `success_count` / `failure_count`)と各 `results` エントリの `request_index` / `ok` / `elapsed_ms` / `args_summary` が含まれ、位置だけに依存せず部分失敗や遅い内部クエリを把握できます。 |
| `validate` | エンコーディング問題(origin/severity 付き U+FFFD、BOM、null バイト、改行混在 / CR-only 行末、UTF-16 BOM 検出、UTF-8 以外と推定されるエンコーディング)を報告 |
| `languages` | 対応言語一覧を拡張子・機能付きで表示 |
| `languages` | 対応言語一覧を拡張子・機能付きで表示。`--indexed-only` と `--capability graph|symbols|references` で現在の DB や機能別に絞り込み可能 |
| `ping` | 軽量な接続確認 |
| `index` | プロジェクトのインデックス作成・更新 |
| `backfill_fold` | 既存 DB の folded-name key をソース再解析なしで更新 |
Expand Down
18 changes: 18 additions & 0 deletions changelog.d/unreleased/3000.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
category: added
issues:
- 3000
affected:
- src/CodeIndex/Cli/QueryCommandRunner.cs
- src/CodeIndex/Cli/CliFlagSchema.cs
- src/CodeIndex/Cli/ConsoleUi.cs
- USER_GUIDE.md
---

## English

- **`languages` can now filter by indexed languages and capability (#3000)** — `cdidx languages` accepts `--indexed-only` to show only languages present in the current database and `--capability graph|symbols|references` to narrow language audits to a specific structured capability.

## 日本語

- **`languages` が indexed language と capability で絞り込めるようになりました (#3000)** — `cdidx languages` は現在のデータベースに存在する言語だけを表示する `--indexed-only` と、特定の構造化 capability に絞る `--capability graph|symbols|references` を受け付けるようになりました。
9 changes: 6 additions & 3 deletions src/CodeIndex/Cli/CliFlagSchema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ internal static class CliFlagSchema
private static readonly string[] EntrypointConfidenceCommands = ["map"];
private static readonly string[] MapSectionCommands = ["map"];
private static readonly string[] DependencyCycleCommands = ["deps"];
private static readonly string[] LanguagesFilterCommands = ["languages"];

// `--exact` is the legacy shorthand that every name-resolution command accepts.
// `--exact` は名前解決系の全コマンドで受け付けるレガシー shorthand。
Expand Down Expand Up @@ -154,7 +155,7 @@ internal static class CliFlagSchema
[
"index", "backfill-fold", "optimize", "search", "definition", "goto", "references", "callers", "callees",
"symbols", "files", "find", "excerpt", "map", "inspect", "outline", "status",
"validate", "deps", "impact", "unused", "hotspots", "db", "vacuum", "report", "batch", "mcp",
"validate", "deps", "impact", "unused", "hotspots", "languages", "db", "vacuum", "report", "batch", "mcp",
];

private static readonly string[] WorkspaceDbCommands = ["deps"];
Expand All @@ -163,14 +164,14 @@ internal static class CliFlagSchema
[
"index", "search", "definition", "goto", "references", "callers", "callees",
"symbols", "files", "find", "excerpt", "map", "inspect", "outline", "status",
"validate", "deps", "impact", "unused", "hotspots", "batch",
"validate", "deps", "impact", "unused", "hotspots", "languages", "batch",
];

private static readonly string[] ReadOnlyDbCommands =
[
"search", "definition", "goto", "references", "callers", "callees",
"symbols", "files", "find", "excerpt", "map", "inspect", "outline", "status",
"validate", "deps", "impact", "unused", "hotspots",
"validate", "deps", "impact", "unused", "hotspots", "languages",
];

private static readonly string[] JsonCommands =
Expand Down Expand Up @@ -239,6 +240,8 @@ private static IReadOnlyList<CliFlag> BuildAll()
new() { Name = "--min-entrypoint-confidence", ValuePlaceholder = "<0.0..1.0>", Description = "Map: omit entrypoint candidates below this confidence", Commands = Set(EntrypointConfidenceCommands) },
new() { Name = "--sections", ValuePlaceholder = "<tree,languages,hotspots,metrics>", Description = "Map: comma-separated response sections to include", Commands = Set(MapSectionCommands) },
new() { Name = "--cycles", Description = "Deps: return dependency cycles instead of edge rows", Commands = Set(DependencyCycleCommands) },
new() { Name = "--indexed-only", Description = "Languages: list only languages present in the current index", Commands = Set(LanguagesFilterCommands) },
new() { Name = "--capability", ValuePlaceholder = "<graph|symbols|references>", Description = "Languages: filter by language capability", Commands = Set(LanguagesFilterCommands) },
new() { Name = "--query", ValuePlaceholder = "<query>", Description = "Literal query", Commands = Set(QueryCommands) },
new() { Name = "--body", Description = "Include body", Commands = Set(BodyCommands) },
new() { Name = "--exact", Description = "Backward-compatible exact shorthand", Commands = Set(ExactCommands) },
Expand Down
2 changes: 1 addition & 1 deletion src/CodeIndex/Cli/ConsoleUi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private static readonly (string Command, string Usage)[] CommandUsageLines =
("export", "cdidx export <archive> [--db <path>] [--json]"),
("export", "cdidx export ctags [--output <path>] [--db <path>]"),
("import", "cdidx import <archive> [--db <path>] [--prune-paths] [--json]"),
("languages", "cdidx languages [--json]"),
("languages", "cdidx languages [--db <path>] [--json] [--indexed-only] [--capability <graph|symbols|references>]"),
("batch", "cdidx batch [--db <path>] # reads JSON string arrays from stdin, one query command per line; max 1,048,576 chars/line and 256 arguments"),
("mcp", "cdidx mcp [--db <path>] [--transport stdio|http] [--http-listen <host:port>] [--audit-log <path>] [--audit-log-include-values] [--audit-log-max-bytes <n>] [--suggestion-dedup-threshold <0..1>]"),
("lsp", "cdidx lsp [--db <path>]"),
Expand Down
Loading
Loading