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
6 changes: 3 additions & 3 deletions pages/src/content/docs/en/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ staged + unstaged + untracked changes in the current directory's repo.
| `--from <ref>` | — | — | Source ref to start the diff from (e.g., `main`). |
| `--to <ref>` | — | — | Target ref to end the diff at (e.g., `feature-branch`). When set, OCR computes `merge-base(from, to)..to`. |
| `--commit <sha>` | `-c` | — | Single commit to review (vs its parent). |
| `--preview` | `-p` | `false` | Run the filter pipeline but skip the LLM. Prints the file list and exclusion reasons. Honors `--format json`. |
| `--preview` | `-p` | `false` | Run the filter pipeline but skip the LLM. Prints the file list and exclusion reasons. Honors `--format json`; `--format sarif` is not supported (a preview has no completed findings to emit). |
| `--resume <session-id>` | — | — | Resume from a previous compatible range or commit review session. |
| `--format <fmt>` | `-f` | `text` | `text` (human-readable) or `json` (machine-readable comment array). |
| `--format <fmt>` | `-f` | `text` | `text` (human-readable), `json` (machine-readable comment array), or `sarif` (SARIF 2.1.0 report for GitHub Code Scanning). |
| `--audience <who>` | — | `human` | `human` streams progress lines; `agent` quiets stdout and prints only the final summary / JSON. |
| `--background <text>` | `-b` | — | Optional requirement / business context injected into the plan + main prompts. |
| `--concurrency <n>` | — | `8` | Maximum number of files reviewed in parallel. |
Expand Down Expand Up @@ -316,7 +316,7 @@ With no `--path`, the whole repository is scanned.
|---|---|---|---|
| `--path <list>` | - | whole repo | Comma-separated repo-relative directories or files to scan (e.g., `internal/agent`, `internal/llm/client.go`). |
| `--exclude <patterns>` | - | - | Comma-separated gitignore-style patterns to skip (e.g., `**/generated/*,*.pb.go`); merged with `rule.json` excludes. |
| `--preview` | `-p` | `false` | Enumerate and filter files without calling the LLM. Prints the file list, reviewable/excluded counts, total lines, and per-file exclusion reasons. Honors `--format json`. |
| `--preview` | `-p` | `false` | Enumerate and filter files without calling the LLM. Prints the file list, reviewable/excluded counts, total lines, and per-file exclusion reasons. Honors `--format json`; `--format sarif` is not supported. |

```bash
ocr scan --preview # see what would be scanned
Expand Down
29 changes: 29 additions & 0 deletions pages/src/content/docs/en/integrations/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,35 @@ for a GitHub App installation token.
Reviews will now appear as posted by your app's name instead of
`github-actions[bot]`.

#### Upload findings to GitHub Code Scanning (SARIF)

`--format sarif` writes a
[SARIF 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html)
report to stdout. Pipe it to a file and upload it with the CodeQL
`upload-sarif` action so findings appear under
**Security → Code scanning**:

```yaml
- name: Run OCR review
env:
BASE_REF: ${{ github.base_ref }}
HEAD_REF: ${{ github.head_ref }}
run: |
ocr review \
--from "origin/$BASE_REF" \
--to "origin/$HEAD_REF" \
--format sarif --audience agent > results.sarif

- uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
```

SARIF is machine-readable, so OCR suppresses progress lines on stdout
and `results.sarif` contains only the report. `--preview` does not
support `--format sarif` — run a full review (or `ocr scan`) to
produce a report.

### Troubleshooting

| Symptom | Cause / Fix |
Expand Down
6 changes: 3 additions & 3 deletions pages/src/content/docs/ja/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ ocr r [flags] (alias)
| `--from <ref>` | — | — | diff の開始 ref(例: `main`)。 |
| `--to <ref>` | — | — | diff の終了 ref(例: `feature-branch`)。設定すると OCR は `merge-base(from, to)..to` を計算します。 |
| `--commit <sha>` | `-c` | — | 単一の commit をレビューします(その親との差分)。 |
| `--preview` | `-p` | `false` | フィルタリングのパイプラインを実行しますが LLM はスキップします。ファイル一覧と除外理由を出力します。`--format json` に対応しています。 |
| `--preview` | `-p` | `false` | フィルタリングのパイプラインを実行しますが LLM はスキップします。ファイル一覧と除外理由を出力します。`--format json` に対応しています。`--format sarif` はサポートされていません(プレビューには出力する完了した指摘がありません)。 |
| `--resume <session-id>` | — | — | 以前の互換性のある範囲または単一 commit レビューセッションから再開します。 |
| `--format <fmt>` | `-f` | `text` | `text`(人間が読みやすい形式)または `json`(機械可読なコメント配列)。 |
| `--format <fmt>` | `-f` | `text` | `text`(人間が読みやすい形式)`json`(機械可読なコメント配列)または `sarif`(GitHub Code Scanning 用の SARIF 2.1.0 レポート)。 |
| `--audience <who>` | — | `human` | `human` は進捗行をストリーム出力します。`agent` は stdout を静音化し、最終サマリー / JSON のみを出力します。 |
| `--background <text>` | `-b` | — | plan + main prompt に注入する、任意の要件 / 業務コンテキスト。 |
| `--concurrency <n>` | — | `8` | 並行してレビューするファイルの最大数。 |
Expand Down Expand Up @@ -292,7 +292,7 @@ ocr s [flags] (alias)
|---|---|---|---|
| `--path <list>` | - | リポジトリ全体 | スキャン対象のリポジトリ相対ディレクトリまたはファイル(カンマ区切り、例: `internal/agent`、`internal/llm/client.go`)。 |
| `--exclude <patterns>` | - | - | 除外する gitignore 形式のパターン(カンマ区切り、例: `**/generated/*,*.pb.go`)。`rule.json` の excludes とマージされます。 |
| `--preview` | `-p` | `false` | LLM を呼び出さずにファイルを列挙・フィルタリングします。ファイルリスト、レビュー対象/除外数、総行数、ファイルごとの除外理由を出力します。`--format json` に対応しています。 |
| `--preview` | `-p` | `false` | LLM を呼び出さずにファイルを列挙・フィルタリングします。ファイルリスト、レビュー対象/除外数、総行数、ファイルごとの除外理由を出力します。`--format json` に対応しています。`--format sarif` はサポートされていません。 |

```bash
ocr scan --preview # スキャン対象を確認
Expand Down
29 changes: 29 additions & 0 deletions pages/src/content/docs/ja/integrations/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,35 @@ if: |

レビューは `github-actions[bot]` ではなく、あなたの app の名前で投稿されるようになります。

#### GitHub Code Scanning に指摘をアップロードする(SARIF)

`--format sarif` は
[SARIF 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html)
レポートを stdout に書き出します。ファイルにリダイレクトし、CodeQL の
`upload-sarif` アクションでアップロードすると、指摘が
**Security → Code scanning** に表示されます:

```yaml
- name: Run OCR review
env:
BASE_REF: ${{ github.base_ref }}
HEAD_REF: ${{ github.head_ref }}
run: |
ocr review \
--from "origin/$BASE_REF" \
--to "origin/$HEAD_REF" \
--format sarif --audience agent > results.sarif

- uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
```

SARIF は機械可読な形式なので、OCR は stdout 上の進捗行を抑制し、
`results.sarif` にはレポートだけが含まれます。`--preview` は
`--format sarif` に対応していません。レポートを生成するには、完全な
review(または `ocr scan`)を実行してください。

### トラブルシューティング

| 症状 | 原因 / 修正 |
Expand Down
6 changes: 3 additions & 3 deletions pages/src/content/docs/ru/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ ocr r [flags] (alias)
| `--from <ref>` | — | — | Исходная ссылка, от которой начинается diff (например, `main`). |
| `--to <ref>` | — | — | Целевая ссылка, на которой заканчивается diff (например, `feature-branch`). Если задана, OCR вычисляет `merge-base(from, to)..to`. |
| `--commit <sha>` | `-c` | — | Один коммит для ревью (сравнивается с родительским). |
| `--preview` | `-p` | `false` | Запускает конвейер фильтрации, но пропускает LLM. Выводит список файлов и причины исключения. Учитывает `--format json`. |
| `--preview` | `-p` | `false` | Запускает конвейер фильтрации, но пропускает LLM. Выводит список файлов и причины исключения. Учитывает `--format json`; `--format sarif` не поддерживается (в предпросмотре нет завершённых находок для вывода). |
| `--resume <session-id>` | — | — | Возобновляет предыдущую совместимую сессию ревью диапазона или коммита. |
| `--format <fmt>` | `-f` | `text` | `text` (для чтения человеком) или `json` (машиночитаемый массив комментариев). |
| `--format <fmt>` | `-f` | `text` | `text` (для чтения человеком), `json` (машиночитаемый массив комментариев) или `sarif` (отчёт SARIF 2.1.0 для GitHub Code Scanning). |
| `--audience <who>` | — | `human` | `human` выводит ход выполнения; `agent` отключает этот вывод в stdout и печатает только итоговую сводку / JSON. |
| `--background <text>` | `-b` | — | Необязательные требования / бизнес-контекст, добавляемые в промпты планирования и основной задачи. |
| `--concurrency <n>` | — | `8` | Максимальное число файлов, проверяемых параллельно. |
Expand Down Expand Up @@ -290,7 +290,7 @@ ocr s [flags] (alias)
|---|---|---|---|
| `--path <list>` | - | весь репозиторий | Относительные каталоги или файлы репозитория для сканирования (через запятую, например `internal/agent`, `internal/llm/client.go`). |
| `--exclude <patterns>` | - | - | Шаблоны исключения в стиле gitignore (через запятую, например `**/generated/*,*.pb.go`); объединяются с excludes из `rule.json`. |
| `--preview` | `-p` | `false` | Перечисляет и фильтрует файлы без вызова LLM. Выводит список файлов, количество проверяемых/исключённых, общее число строк и причины исключения для каждого файла. Учитывает `--format json`. |
| `--preview` | `-p` | `false` | Перечисляет и фильтрует файлы без вызова LLM. Выводит список файлов, количество проверяемых/исключённых, общее число строк и причины исключения для каждого файла. Учитывает `--format json`; `--format sarif` не поддерживается. |

```bash
ocr scan --preview # посмотреть, что будет просканировано
Expand Down
29 changes: 29 additions & 0 deletions pages/src/content/docs/ru/integrations/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,35 @@ if: |
Теперь ревью будут публиковаться от имени приложения вместо
`github-actions[bot]`.

#### Загрузка находок в GitHub Code Scanning (SARIF)

`--format sarif` записывает отчёт
[SARIF 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html)
в stdout. Перенаправьте его в файл и загрузите с помощью action
`upload-sarif` из CodeQL, чтобы находки появились в разделе
**Security → Code scanning**:

```yaml
- name: Run OCR review
env:
BASE_REF: ${{ github.base_ref }}
HEAD_REF: ${{ github.head_ref }}
run: |
ocr review \
--from "origin/$BASE_REF" \
--to "origin/$HEAD_REF" \
--format sarif --audience agent > results.sarif

- uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
```

SARIF — машиночитаемый формат, поэтому OCR подавляет строки прогресса в
stdout, и в `results.sarif` попадает только отчёт. `--preview` не
поддерживает `--format sarif` — для получения отчёта запустите полное
review (или `ocr scan`).

### Устранение неполадок

| Симптом | Причина / исправление |
Expand Down
6 changes: 3 additions & 3 deletions pages/src/content/docs/zh/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ unstaged + untracked 变更。
| `--from <ref>` | — | — | diff 起始 ref(如 `main`)。 |
| `--to <ref>` | — | — | diff 结束 ref(如 `feature-branch`)。设置后 OCR 计算 `merge-base(from, to)..to`。 |
| `--commit <sha>` | `-c` | — | 评审单个 commit(相对其父)。 |
| `--preview` | `-p` | `false` | 运行过滤流水线但跳过 LLM。打印文件列表与排除原因。支持 `--format json`。 |
| `--preview` | `-p` | `false` | 运行过滤流水线但跳过 LLM。打印文件列表与排除原因。支持 `--format json`;不支持 `--format sarif`(预览没有已完成的发现可供输出)。 |
| `--resume <session-id>` | — | — | 从之前兼容的区间或单 commit 评审会话恢复。 |
| `--format <fmt>` | `-f` | `text` | `text`(人类可读)`json`(机器可读的评论数组)。 |
| `--format <fmt>` | `-f` | `text` | `text`(人类可读)`json`(机器可读的评论数组)或 `sarif`(用于 GitHub Code Scanning 的 SARIF 2.1.0 报告)。 |
| `--audience <who>` | — | `human` | `human` 流式输出进度行;`agent` 静默 stdout,只打印最终摘要 / JSON。 |
| `--background <text>` | `-b` | — | 注入 plan + main prompt 的可选需求 / 业务上下文。 |
| `--concurrency <n>` | — | `8` | 并行评审的最大文件数。 |
Expand Down Expand Up @@ -301,7 +301,7 @@ ocr s [flags] (alias)
|---|---|---|---|
| `--path <list>` | - | 整个仓库 | 逗号分隔的仓库相对目录或文件(如 `internal/agent`、`internal/llm/client.go`)。 |
| `--exclude <patterns>` | - | - | 逗号分隔的 gitignore 风格排除模式(如 `**/generated/*,*.pb.go`);与 `rule.json` 的 excludes 合并。 |
| `--preview` | `-p` | `false` | 枚举并过滤文件但跳过 LLM。打印文件列表、可评审/排除数量、总行数及每个文件的排除原因。支持 `--format json`。 |
| `--preview` | `-p` | `false` | 枚举并过滤文件但跳过 LLM。打印文件列表、可评审/排除数量、总行数及每个文件的排除原因。支持 `--format json`;不支持 `--format sarif`。 |

```bash
ocr scan --preview # 查看会扫描哪些文件
Expand Down
27 changes: 27 additions & 0 deletions pages/src/content/docs/zh/integrations/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,33 @@ if: |

评审现在会以你 app 的名字而非 `github-actions[bot]` 发布。

#### 将发现上传到 GitHub Code Scanning(SARIF)

`--format sarif` 会把
[SARIF 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html)
报告写入 stdout。把它重定向到文件,并用 CodeQL 的 `upload-sarif`
action 上传,让发现出现在 **Security → Code scanning** 下:

```yaml
- name: Run OCR review
env:
BASE_REF: ${{ github.base_ref }}
HEAD_REF: ${{ github.head_ref }}
run: |
ocr review \
--from "origin/$BASE_REF" \
--to "origin/$HEAD_REF" \
--format sarif --audience agent > results.sarif

- uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
```

SARIF 是机器可读格式,因此 OCR 会在 stdout 上抑制进度行,`results.sarif`
只包含报告本身。`--preview` 不支持 `--format sarif`——请运行完整的
review(或 `ocr scan`)来生成报告。

### 故障排查

| 症状 | 原因 / 修复 |
Expand Down
4 changes: 2 additions & 2 deletions pages/src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export const en = {
'docs.reviewFlag1Desc': 'Specify commit hash to review',
'docs.reviewFlag2Desc': 'Start ref (diff origin)',
'docs.reviewFlag3Desc': 'Target ref (diff endpoint)',
'docs.reviewFlag4Desc': 'Output format: text or json',
'docs.reviewFlag4Desc': 'Output format: text, json, or sarif',
'docs.reviewFlag5Desc': 'Git repository root',
'docs.reviewFlag5Default': 'Current dir',
'docs.reviewFlag6Desc': 'Path to review rules JSON file',
Expand Down Expand Up @@ -223,7 +223,7 @@ export const en = {
'docs.scanFlag6Desc': 'Skip the per-batch DEDUP_TASK',
'docs.scanFlag7Desc': 'Skip the post-run PROJECT_SUMMARY_TASK',
'docs.scanFlag8Desc': 'Batching strategy: none | by-language | by-directory',
'docs.scanFlag9Desc': 'Output format: text or json',
'docs.scanFlag9Desc': 'Output format: text, json, or sarif',
'docs.scanFlag10Desc': 'Max concurrent file scans',
'docs.scanFlag11Desc': 'Concurrent task timeout in minutes',
'docs.scanFlag12Desc': 'Output audience: human (show progress) or agent (summary only)',
Expand Down
4 changes: 2 additions & 2 deletions pages/src/i18n/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export const ja: TranslationKeys = {
'docs.reviewFlag1Desc': 'レビューするコミットハッシュを指定',
'docs.reviewFlag2Desc': '開始参照(差分の起点)',
'docs.reviewFlag3Desc': 'ターゲット参照(差分の終点)',
'docs.reviewFlag4Desc': '出力形式:text または json',
'docs.reviewFlag4Desc': '出力形式:text、json または sarif',
'docs.reviewFlag5Desc': 'Git リポジトリルート',
'docs.reviewFlag5Default': '現在のディレクトリ',
'docs.reviewFlag6Desc': 'レビュールール JSON ファイルパス',
Expand Down Expand Up @@ -227,7 +227,7 @@ export const ja: TranslationKeys = {
'docs.scanFlag6Desc': 'バッチ単位の DEDUP_TASK をスキップ',
'docs.scanFlag7Desc': '実行後の PROJECT_SUMMARY_TASK をスキップ',
'docs.scanFlag8Desc': 'バッチ処理戦略:none | by-language | by-directory',
'docs.scanFlag9Desc': '出力形式:text または json',
'docs.scanFlag9Desc': '出力形式:text、json または sarif',
'docs.scanFlag10Desc': '最大並行ファイルスキャン数',
'docs.scanFlag11Desc': '並行タスクのタイムアウト(分)',
'docs.scanFlag12Desc': '出力対象:human(進捗表示)または agent(サマリーのみ)',
Expand Down
4 changes: 2 additions & 2 deletions pages/src/i18n/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export const ru: TranslationKeys = {
'docs.reviewFlag1Desc': 'Хеш коммита для ревью',
'docs.reviewFlag2Desc': 'Начальный ref (начало diff)',
'docs.reviewFlag3Desc': 'Целевой ref (конец diff)',
'docs.reviewFlag4Desc': 'Формат вывода: text или json',
'docs.reviewFlag4Desc': 'Формат вывода: text, json или sarif',
'docs.reviewFlag5Desc': 'Корень Git-репозитория',
'docs.reviewFlag5Default': 'Текущая директория',
'docs.reviewFlag6Desc': 'Путь к JSON-файлу правил ревью',
Expand Down Expand Up @@ -225,7 +225,7 @@ export const ru: TranslationKeys = {
'docs.scanFlag6Desc': 'Пропустить DEDUP_TASK на пакет',
'docs.scanFlag7Desc': 'Пропустить финальный PROJECT_SUMMARY_TASK',
'docs.scanFlag8Desc': 'Стратегия группировки: none | by-language | by-directory',
'docs.scanFlag9Desc': 'Формат вывода: text или json',
'docs.scanFlag9Desc': 'Формат вывода: text, json или sarif',
'docs.scanFlag10Desc': 'Макс. параллельных проверок файлов',
'docs.scanFlag11Desc': 'Таймаут параллельных задач в минутах',
'docs.scanFlag12Desc': 'Аудитория вывода: human (показывать прогресс) или agent (только сводка)',
Expand Down
Loading
Loading