Skip to content
32 changes: 24 additions & 8 deletions USER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -927,10 +927,16 @@ cdidx search "File.ReadAllText" --exact-substring --reject-before "Length" --gua
cdidx search "FileMode.Create" --exact-substring --require-after "File.Move" --guard-window 12 # require a nearby follow-up action
cdidx search --list-recipes # show reusable audit recipes
cdidx search --recipe risky-code --json # run a curated audit query set and return grouped JSON
cdidx search --recipe risky-code/raw-diagnostic-echo --json # run one child query from a recipe
cdidx search --recipe risky-code --include-query raw-diagnostic-echo --exclude-query cancellation-gap --json
cdidx search --recipe risky-code/raw-diagnostic-echo --format compact --limit 20 # summary-first compact JSON with next_cursor
cdidx search --recipe risky-code/raw-diagnostic-echo --format compact --cursor <next_cursor>
cdidx search --named-query pack="dotnet pack" --named-query push="nuget push" --format compact # named ad hoc batch with compact snippets
cdidx search "catch (Exception" --group-by file --count --json # rank broad audit hits by file
cdidx search "JsonDocument.Parse" --group-by symbol --count --json # rank broad audit hits by enclosing symbol
cdidx search --recipe risky-code --format issue-drafts --open-issues open-issues.json # issue draft JSON with duplicate preflight
cdidx search --recipe risky-code --format issue-drafts --open-issues github --repo Widthdom/CodeIndex # preflight against live open GitHub issues
cdidx search "Thread.Yield" --format issue-drafts --issue-title "Thread.Yield audit" --issue-label audit # ad hoc issue draft JSON
cdidx search "--open-reports" --path README.md --count # quoted literal that starts with --
cdidx search --query "--path" --path README.md # search for an option-looking literal
```
Expand Down Expand Up @@ -1304,7 +1310,8 @@ same source location.
| `--limit <n>` | `suggestions list`, `suggestions export` | Cap emitted suggestion records after filters and newest-first ordering. |
| `--offset <n>` | `suggestions list`, `suggestions export` | Skip filtered suggestion records after newest-first ordering before emitting results. |
| `--format <json\|markdown\|issue-drafts>` | `suggestions export` | Choose export format. JSON is the default, markdown is intended for human triage, and issue-drafts emits issue-ready draft objects. |
| `--open-issues <path>` | `suggestions export --format issue-drafts` | Preflight drafts against an open-issues JSON file such as `gh issue list --state open --json number,title,labels,url`. Inputs are capped at 8 MiB, 32 JSON nesting levels, 1000 issue entries, 32 labels per issue, and bounded title/URL/label strings. |
| `--open-issues <path\|github\|github:owner/name>` / `--repo <owner/name>` | `search --format issue-drafts`, `suggestions export --format issue-drafts` | Preflight drafts against an open-issues JSON file such as `gh issue list --state open --json number,title,labels,url`; both commands can also fetch live open GitHub issues with `--open-issues github --repo owner/name` or `--open-issues github:owner/name`. Inputs are capped at 8 MiB, 32 JSON nesting levels, 1000 issue entries, 32 labels per issue, and bounded title/URL/label strings. |
| `--issue-title <title>` / `--issue-label <label>` | `search --format issue-drafts` | Set the title for an ad hoc search draft and add label hints. `--issue-label` can be repeated or comma-separated. |
| `--check` | `status` | Verify that `.cdidx/codeindex.db` exactly matches the current indexable workspace by comparing DB file paths/checksums against a fresh filesystem scan. Matching indexes exit `0`; stale indexes exit `5`. |
| `--dry-run` | `index` | Scan files and report what would change without writing to the database |
| `--limit <n>` | Query result commands except `suggestions` | Max results (default: 20, max: 10000; `map` uses it per section) |
Expand All @@ -1313,9 +1320,10 @@ same source location.
| `--exclude-visibility <v[,v]>` | `definition`, `symbols`, `unused`, `hotspots` | Exclude symbols with the requested visibility values. Accepts the same comma-separated values and alias expansion as `--visibility`. |
| `--path <glob>` | `search`, `definition`, `references`, `callers`, `callees`, `symbols`, `files`, `find`, `map`, `inspect`, `validate` | Restrict results to glob-style path patterns. `*` and `?` are wildcards. Repeatable; multiple values are OR'd together |
| `--query <query>` | `search`, `definition`, `references`, `callers`, `callees`, `symbols`, `files`, `find`, `inspect`, `impact` | Pass a query literal explicitly, useful when the query starts with `-`. Query commands except `find` also accept `-- <query>` as a one-token query escape while continuing to parse later options. |
| `--recipe <name>` | `search` | Run a reusable audit recipe such as `risky-code`. Normal search filters and snippet controls apply to every recipe query; text, `--json` / `--format json`, and `--format issue-drafts` are supported. |
| `--list-recipes` | `search` | List available search audit recipes with query text, recommended labels, exact-match mode, and false-positive guidance. |
| `--open-issues <path>` | `search --recipe <name> --format issue-drafts` | Preflight generated issue drafts against an open-issues JSON file such as `gh issue list --state open --json number,title,labels,url`. |
| `--recipe <name>` | `search` | Run a reusable audit recipe such as `risky-code`. Use `recipe/query` form, such as `risky-code/raw-diagnostic-echo`, to run one child query directly. Normal search filters and snippet controls apply to every selected recipe query; `--limit` / `--top` is per child query. Text, `--json` / `--format json`, `--format compact`, and `--format issue-drafts` are supported, and issue drafts include a replay command. |
| `--include-query <name>` / `--exclude-query <name>` | `search --recipe <name>` | Include or exclude child recipe queries by name. Repeatable and comma-separated; names are listed by `cdidx search --list-recipes`. |
| `--cursor <cursor>` | `search --recipe <name/query>` | Fetch the next page for one selected recipe child query. Use the `next_cursor` returned by recipe JSON or compact output. |
| `--list-recipes` | `search` | List available search audit recipes with query text, recommended labels, exact-match mode, false-positive guidance, supported formats, filter support, and limit semantics. |
| `--exclude-path <glob>` | `search`, `definition`, `references`, `callers`, `callees`, `symbols`, `files`, `find`, `map`, `inspect` | Exclude glob-style path patterns. `*` and `?` are wildcards (repeatable) |
| `--exclude-tests` | `search`, `definition`, `references`, `callers`, `callees`, `symbols`, `files`, `find`, `map`, `inspect` | Exclude likely test files and prefer production code |
| `--exclude-comments` | `search` | Exclude matches whose only retained origin is a comment |
Expand Down Expand Up @@ -3365,10 +3373,16 @@ cdidx search "File.ReadAllText" --exact-substring --reject-before "Length" --gua
cdidx search "FileMode.Create" --exact-substring --require-after "File.Move" --guard-window 12 # 近傍の後続処理を要求
cdidx search --list-recipes # 再利用可能な audit recipe を表示
cdidx search --recipe risky-code --json # curated audit query set を実行し、grouped JSON を返す
cdidx search --recipe risky-code/raw-diagnostic-echo --json # recipe 内の child query を1つだけ実行
cdidx search --recipe risky-code --include-query raw-diagnostic-echo --exclude-query cancellation-gap --json
cdidx search --recipe risky-code/raw-diagnostic-echo --format compact --limit 20 # summary-first compact JSON と next_cursor
cdidx search --recipe risky-code/raw-diagnostic-echo --format compact --cursor <next_cursor>
cdidx search --named-query pack="dotnet pack" --named-query push="nuget push" --format compact # 名前付き ad hoc batch と compact snippet
cdidx search "catch (Exception" --group-by file --count --json # 広い audit hit を file 別にランク付け
cdidx search "JsonDocument.Parse" --group-by symbol --count --json # 広い audit hit を enclosing symbol 別にランク付け
cdidx search --recipe risky-code --format issue-drafts --open-issues open-issues.json # duplicate preflight 付き issue draft JSON
cdidx search --recipe risky-code --format issue-drafts --open-issues github --repo Widthdom/CodeIndex # GitHub の live open issue と照合
cdidx search "Thread.Yield" --format issue-drafts --issue-title "Thread.Yield audit" --issue-label audit # ad hoc issue draft JSON
cdidx search "--open-reports" --path README.md --count # `--` で始まる引用済みリテラル
cdidx search --query "--path" --path README.md # オプションに見えるリテラルを検索
```
Expand Down Expand Up @@ -3734,17 +3748,19 @@ raw match density を正確に測る、といった理由で全 raw chunk hit
| `--limit <n>` | `suggestions list`, `suggestions export` | filter と新しい順の並び替え後に出力する提案レコード数を制限します。 |
| `--offset <n>` | `suggestions list`, `suggestions export` | filter と新しい順の並び替え後、出力前に指定件数の提案レコードをスキップします。 |
| `--format <json\|markdown\|issue-drafts>` | `suggestions export` | エクスポート形式を選びます。既定は JSON、markdown は人間の triage 共有向け、issue-drafts は Issue 作成用の draft object を出力します。 |
| `--open-issues <path>` | `suggestions export --format issue-drafts` | `gh issue list --state open --json number,title,labels,url` などの open issue JSON と照合して draft を事前重複確認します。入力は 8 MiB、JSON ネスト 32 段、issue entry 1000 件、issue ごとの label 32 件、title / URL / label 文字列長の上限に制限されます。 |
| `--open-issues <path\|github\|github:owner/name>` / `--repo <owner/name>` | `search --format issue-drafts`, `suggestions export --format issue-drafts` | `gh issue list --state open --json number,title,labels,url` などの open issue JSON と照合して draft を事前重複確認します。どちらのコマンドも `--open-issues github --repo owner/name` または `--open-issues github:owner/name` で GitHub の live open issue も取得できます。入力は 8 MiB、JSON ネスト 32 段、issue entry 1000 件、issue ごとの label 32 件、title / URL / label 文字列長の上限に制限されます。 |
| `--issue-title <title>` / `--issue-label <label>` | `search --format issue-drafts` | ad hoc search draft の title を指定し、label hint を追加します。`--issue-label` は繰り返し指定またはカンマ区切りに対応します。 |
| `--check` | `status` | DB のファイル path/checksum と現在の index 対象 workspace を比較し、`.cdidx/codeindex.db` が完全一致するか確認。完全一致なら終了コード `0`、stale なら `5` |
| `--dry-run` | `index` | DB に書き込まず、どの変更が発生するかだけを走査して報告 |
| `--limit <n>` | `suggestions` 以外のクエリ結果コマンド | 最大結果数(デフォルト: 20、最大: 10000。`map` では各セクションごとの件数) |
| `--visibility <v[,v]>` | `definition`, `symbols`, `unused`, `hotspots` | `public`, `protected`, `internal`, `private` の可視性でシンボルを絞り込む。`public` は `pub`、`open`、`export` などの保存済み exported alias にも一致し、`private` は `fileprivate` にも一致 |
| `--exclude-visibility <v[,v]>` | `definition`, `symbols`, `unused`, `hotspots` | 指定した可視性のシンボルを除外する。値と alias 展開は `--visibility` と同じ |
| `--path <glob>` | `search`, `definition`, `references`, `callers`, `callees`, `symbols`, `files`, `find`, `map`, `inspect`, `validate` | glob 形式のパスパターンで結果を絞る。`*` と `?` がワイルドカード。繰り返し指定可(複数値は OR で結合) |
| `--query <query>` | `search`, `definition`, `references`, `callers`, `callees`, `symbols`, `files`, `find`, `inspect`, `impact` | クエリを明示的なリテラルとして渡す。クエリが `-` で始まる場合に有用。`find` 以外のクエリ系コマンドでは `-- <query>` も1トークンのクエリエスケープとして受け付け、その後のオプション解析を続ける。 |
| `--recipe <name>` | `search` | `risky-code` などの再利用可能な audit recipe を実行する。通常の search filter と snippet control は recipe 内の各 query に適用され、text、`--json` / `--format json`、`--format issue-drafts` に対応する。 |
| `--list-recipes` | `search` | 利用可能な search audit recipe を query text、推奨 label、exact-match mode、false-positive guidance 付きで一覧表示する。 |
| `--open-issues <path>` | `search --recipe <name> --format issue-drafts` | `gh issue list --state open --json number,title,labels,url` のような open issue JSON file と照合し、生成した issue draft を事前重複確認する。 |
| `--recipe <name>` | `search` | `risky-code` などの再利用可能な audit recipe を実行する。`risky-code/raw-diagnostic-echo` のような `recipe/query` 形式で child query を1つだけ直接実行できる。通常の search filter と snippet control は選択された各 query に適用され、`--limit` / `--top` は child query ごとの上限になる。text、`--json` / `--format json`、`--format compact`、`--format issue-drafts` に対応し、issue draft には再実行コマンドを含める。 |
| `--include-query <name>` / `--exclude-query <name>` | `search --recipe <name>` | recipe 内の child query を名前で含める、または除外する。繰り返し指定とカンマ区切りに対応し、名前は `cdidx search --list-recipes` で確認できる。 |
| `--cursor <cursor>` | `search --recipe <name/query>` | 選択した recipe child query の次ページを取得する。recipe JSON または compact output が返す `next_cursor` を指定する。 |
| `--list-recipes` | `search` | 利用可能な search audit recipe を query text、推奨 label、exact-match mode、false-positive guidance、対応 format、filter support、limit semantics 付きで一覧表示する。 |
| `--exclude-path <glob>` | `search`, `definition`, `references`, `callers`, `callees`, `symbols`, `files`, `find`, `map`, `inspect` | glob 形式のパスパターンを除外する。`*` と `?` がワイルドカード。繰り返し指定可 |
| `--exclude-tests` | `search`, `definition`, `references`, `callers`, `callees`, `symbols`, `files`, `find`, `map`, `inspect` | テストらしいパスを除外し、本番コードを優先 |
| `--exclude-comments` | `search` | 保持される一致 origin がコメントだけの検索結果を除外する |
Expand Down
22 changes: 22 additions & 0 deletions changelog.d/unreleased/3392.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
category: added
issues:
- 3392
affected:
- src/CodeIndex/Cli/SearchAuditRecipes.cs
- src/CodeIndex/Cli/QueryCommandRunner.cs
- src/CodeIndex/Cli/JsonOutputContracts.cs
- src/CodeIndex/Cli/CliFlagSchema.cs
- src/CodeIndex/Cli/ConsoleUi.cs
- tests/CodeIndex.Tests/QueryCommandRunnerSearchTests.cs
- tests/CodeIndex.Tests/ConsoleUiTests.cs
- USER_GUIDE.md
---

## English

- **Recipe search now supports compact JSON and pagination cursors (#3392)** — `cdidx search --recipe recipe/query --format compact` emits summary-first JSON with top files, snippet-free locations, and `next_cursor` values for paging one child query.

## 日本語

- **recipe search が compact JSON と pagination cursor に対応しました (#3392)** — `cdidx search --recipe recipe/query --format compact` は top files、snippet なしの位置情報、child query 1件をページングするための `next_cursor` を含む summary-first JSON を出力します。
19 changes: 19 additions & 0 deletions changelog.d/unreleased/3447.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
category: added
issues:
- 3447
affected:
- src/CodeIndex/Cli/SearchAuditRecipes.cs
- src/CodeIndex/Cli/QueryCommandRunner.cs
- src/CodeIndex/Cli/JsonOutputContracts.cs
- tests/CodeIndex.Tests/QueryCommandRunnerSearchTests.cs
- USER_GUIDE.md
---

## English

- **Recipe metadata and issue-draft replay commands are now exposed (#3447)** — `search --list-recipes --json` includes supported formats, filter support, and per-query limit semantics, and recipe issue drafts include a replayable `cdidx search` command.

## 日本語

- **recipe metadata と issue-draft replay command を出力するようになりました (#3447)** — `search --list-recipes --json` は対応 format、filter support、per-query の limit semantics を含み、recipe issue draft には再実行可能な `cdidx search` コマンドを含めます。
23 changes: 23 additions & 0 deletions changelog.d/unreleased/3449.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
category: added
issues:
- 3449
affected:
- src/CodeIndex/Cli/IssueDuplicatePreflight.cs
- src/CodeIndex/Cli/QueryCommandRunner.cs
- src/CodeIndex/Cli/SuggestionsCommandRunner.cs
- src/CodeIndex/Cli/ConsoleUi.cs
- src/CodeIndex/Cli/CliFlagSchema.cs
- tests/CodeIndex.Tests/IssueDuplicatePreflightTests.cs
- tests/CodeIndex.Tests/ProgramCliTests.cs
- tests/CodeIndex.Tests/ConsoleUiTests.cs
- USER_GUIDE.md
---

## English

- **Issue-draft duplicate preflight can fetch open GitHub issues directly (#3449)** — `cdidx search --format issue-drafts --open-issues github --repo owner/name` and `cdidx suggestions export --format issue-drafts --open-issues github --repo owner/name` now preflight drafts against live open GitHub issues without requiring a local JSON export.

## 日本語

- **issue-draft の重複事前確認で GitHub の open issue を直接取得できるようになりました (#3449)** — `cdidx search --format issue-drafts --open-issues github --repo owner/name` と `cdidx suggestions export --format issue-drafts --open-issues github --repo owner/name` は、ローカル JSON export を用意せずに GitHub の live open issue と draft を照合できます。
20 changes: 20 additions & 0 deletions changelog.d/unreleased/3519.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
category: added
issues:
- 3519
affected:
- src/CodeIndex/Cli/QueryCommandRunner.cs
- src/CodeIndex/Cli/CliFlagSchema.cs
- src/CodeIndex/Cli/ConsoleUi.cs
- tests/CodeIndex.Tests/QueryCommandRunnerSearchTests.cs
- tests/CodeIndex.Tests/ConsoleUiTests.cs
- USER_GUIDE.md
---

## English

- **Search recipes can now run selected child queries (#3519)** — `cdidx search --recipe recipe/query` runs one child query directly, while repeatable `--include-query` and `--exclude-query` select recipe subsets.

## 日本語

- **search recipe で選択した child query を実行できるようになりました (#3519)** — `cdidx search --recipe recipe/query` で child query を1つだけ直接実行でき、繰り返し指定可能な `--include-query` と `--exclude-query` で recipe subset を選択できます。
21 changes: 21 additions & 0 deletions changelog.d/unreleased/3520.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
category: added
issues:
- 3520
affected:
- src/CodeIndex/Cli/QueryCommandRunner.cs
- src/CodeIndex/Cli/SearchAuditRecipes.cs
- src/CodeIndex/Cli/ConsoleUi.cs
- src/CodeIndex/Cli/CliFlagSchema.cs
- tests/CodeIndex.Tests/QueryCommandRunnerSearchTests.cs
- tests/CodeIndex.Tests/ConsoleUiTests.cs
- USER_GUIDE.md
---

## English

- **Ad hoc search issue-drafts are now supported (#3520)** — `cdidx search <query> --format issue-drafts` can emit issue-ready draft JSON without a named recipe, with `--issue-title` and repeatable `--issue-label` hints for triage metadata.

## 日本語

- **ad hoc search から issue-drafts を出力できるようになりました (#3520)** — `cdidx search <query> --format issue-drafts` は named recipe なしで Issue 作成用 draft JSON を出力でき、`--issue-title` と繰り返し指定可能な `--issue-label` で triage metadata を補えます。
Loading
Loading