Skip to content

docs(cli-reference): document ocr scan flags - #770

Merged
lizhengfeng101 merged 2 commits into
alibaba:mainfrom
woandzym-stack:docs/scan-cli-reference
Aug 7, 2026
Merged

docs(cli-reference): document ocr scan flags#770
lizhengfeng101 merged 2 commits into
alibaba:mainfrom
woandzym-stack:docs/scan-cli-reference

Conversation

@woandzym-stack

Copy link
Copy Markdown
Contributor

Description

Adds a dedicated ## ocr scan section to the CLI reference (en + zh),
documenting the three most commonly used scan flags: --path, --exclude,
and --preview.

Previously ocr scan only had a single row in the command summary table —
no flag reference and no usage examples. Users had no documented way to
scope a scan to specific paths, exclude generated files, or preview the
scan range without calling the LLM.

The section includes:

  • A short synopsis and the default behavior (whole-repo scan when no
    --path is given).
  • A flags table with defaults and descriptions for --path, --exclude,
    and --preview.
  • Usage examples.
  • A pointer to ocr scan -h for the full flag list, so the three documented flags
    aren't mistaken for the complete set.

Both en and zh are updated in sync. No source code or README changes.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring (no functional changes)
  • Documentation update
  • CI / Build / Tooling

How Has This Been Tested?

  • make test passes locally
  • Manual testing (describe below)

Documentation only — no code changes. Verified every flag, default, and
behavior against the source:

  • Flag defaults/descriptions: cmd/opencodereview/shared_flags.go
    (registerScanFlags)
  • --preview output (file list, reviewable/excluded counts, total lines,
    exclusion reasons): internal/scan/preview.go
  • Template defaults: internal/config/template/scan_template.json

Checklist

  • My code follows the project's coding style (go fmt, go vet) — N/A, docs only
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or my feature works — N/A, docs only
  • New and existing unit tests pass locally with my changes — N/A, docs only
  • I have updated the documentation accordingly (if applicable)
  • I have signed the CLA — will sign when the CLA bot prompts

Related Issues

None

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

OpenCodeReview: Review skipped: no items were selected.

@lizhengfeng101 lizhengfeng101 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the ocr scan section — the flag documentation is accurate and the examples are helpful.

A couple of minor suggestions:

  1. ja/ru localization: The cli-reference docs exist in four languages (en, zh, ja, ru). This PR covers en and zh — could you add the equivalent section to ja and ru as well for consistency? (Or open a follow-up issue if you'd prefer.)

  2. Chinese typography (zh): The line LLM 评审--适合审计陌生代码库 uses -- which may be confused with a CLI flag. Consider replacing with an em-dash —— or spacing it out.

  3. English dash style (en, minor): sent to the LLM - useful for auditing — a spaced em-dash () or unspaced em-dash () would be more conventional.

Otherwise LGTM — the flags match the source in shared_flags.go and the ocr scan -h pointer at the end is a nice touch.

@woandzym-stack
woandzym-stack force-pushed the docs/scan-cli-reference branch from 60125fe to ecf8853 Compare August 7, 2026 11:31
@CLAassistant

CLAassistant commented Aug 7, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@woandzym-stack

Copy link
Copy Markdown
Contributor Author

Thanks for the review! All three suggestions addressed:

  • ja/ru localization: added the equivalent ocr scan section to both
    ja/cli-reference.md and ru/cli-reference.md.
  • zh typography: replaced -- with an em-dash in the scan description.
  • en dash style: replaced the spaced hyphen with a spaced em-dash in the
    scan description.

@wu21-web wu21-web left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. The documentation is clear, just one issue here:

Comment thread pages/src/content/docs/zh/cli-reference.md Outdated
Co-authored-by: Tao Xin <wu2196674@icloud.com>

@lizhengfeng101 lizhengfeng101 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lizhengfeng101
lizhengfeng101 merged commit adbd4fd into alibaba:main Aug 7, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants