@alibaba-group/open-code-review 1.4.1 → 1.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.ja-JP.md CHANGED
@@ -1,14 +1,29 @@
1
- <p align="center">
1
+ <div align="center">
2
2
  <a href="https://alibaba.github.io/open-code-review/">
3
- <img src="imgs/logo.svg" alt="OpenCodeReview logo" width="240" height="240">
3
+ <img src="imgs/logo-core.svg" alt="OpenCodeReview logo" width="180" />
4
+ </a>
5
+ <h1>OpenCodeReview</h1>
6
+ </div>
7
+
8
+ <p align="center">
9
+ <a href="https://trendshift.io/repositories/41087" target="_blank">
10
+ <img src="https://trendshift.io/api/badge/trendshift/repositories/41087/weekly?language=Go" alt="alibaba%2Fopen-code-review | Trendshift" style="width: 320px; height: 70px;" width="320" height="70" />
4
11
  </a>
5
12
  </p>
6
- <p align="center">オープンソースのAIコードレビューエージェント。</p>
7
13
  <p align="center">
8
14
  <a href="https://www.npmjs.com/package/@alibaba-group/open-code-review"><img alt="npm" src="https://img.shields.io/npm/v/@alibaba-group/open-code-review?style=flat-square" /></a>
9
15
  <a href="https://github.com/alibaba/open-code-review/actions/workflows/release.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/alibaba/open-code-review/release.yml?style=flat-square" /></a>
10
16
  <a href="https://goreportcard.com/report/github.com/alibaba/open-code-review"><img alt="Go Report Card" src="https://goreportcard.com/badge/github.com/alibaba/open-code-review?style=flat-square" /></a>
11
17
  <a href="https://github.com/alibaba/open-code-review/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/github/license/alibaba/open-code-review?style=flat-square" /></a>
18
+ <a href="https://deepwiki.com/alibaba/open-code-review"><img alt="Ask DeepWiki" src="https://deepwiki.com/badge.svg" /></a>
19
+ <a href="https://www.bestpractices.dev/projects/13328"><img alt="OpenSSF Best Practices" src="https://www.bestpractices.dev/projects/13328/badge" /></a>
20
+ </p>
21
+ <p align="center">
22
+ <a href="#supported-platforms"><img alt="Windows" src="https://img.shields.io/badge/Windows-supported-blue.svg" /></a>
23
+ <a href="#supported-platforms"><img alt="macOS" src="https://img.shields.io/badge/macOS-supported-blue.svg" /></a>
24
+ <a href="#supported-platforms"><img alt="Linux" src="https://img.shields.io/badge/Linux-supported-blue.svg" /></a>
25
+ <a href="#supported-agents"><img alt="Claude Code" src="https://img.shields.io/badge/Claude_Code-supported-blueviolet.svg" /></a>
26
+ <a href="#supported-agents"><img alt="Codex" src="https://img.shields.io/badge/Codex-supported-blueviolet.svg" /></a>
12
27
  </p>
13
28
  <p align="center">
14
29
  <a href="README.md">English</a> | <a href="README.zh-CN.md">简体中文</a> | 日本語 | <a href="README.ko-KR.md">한국어</a> | <a href="README.ru-RU.md">Русский</a>
@@ -88,7 +103,23 @@ npm install -g @alibaba-group/open-code-review
88
103
 
89
104
  **GitHub Releaseから**
90
105
 
91
- [GitHub Releases](https://github.com/alibaba/open-code-review/releases)から最新のバイナリをダウンロードします:
106
+ 1 つのコマンドで、お使いの OS / アーキテクチャ向けの最新バイナリをインストールできます(macOS / Linux):
107
+
108
+ ```bash
109
+ curl -fsSL https://raw.githubusercontent.com/alibaba/open-code-review/main/install.sh | sh
110
+ ```
111
+
112
+ このスクリプトは適切なリリースバイナリを選択し、SHA-256 チェックサムを検証して、`ocr` として `/usr/local/bin` にインストールします。インストール先は `OCR_INSTALL_DIR` で、リリースバージョンは `OCR_VERSION` で上書きできます:
113
+
114
+ ```bash
115
+ OCR_INSTALL_DIR="$HOME/.local/bin" OCR_VERSION=v1.3.13 \
116
+ sh -c "$(curl -fsSL https://raw.githubusercontent.com/alibaba/open-code-review/main/install.sh)"
117
+ ```
118
+
119
+ <details>
120
+ <summary>手動ダウンロード(Windows を含む全プラットフォーム)</summary>
121
+
122
+ [GitHub Releases](https://github.com/alibaba/open-code-review/releases)からお使いのプラットフォーム向けのバイナリをダウンロードします:
92
123
 
93
124
  ```bash
94
125
  # macOS (Apple Silicon)
@@ -114,6 +145,8 @@ curl -Lo ocr.exe https://github.com/alibaba/open-code-review/releases/latest/dow
114
145
  curl -Lo ocr.exe https://github.com/alibaba/open-code-review/releases/latest/download/opencodereview-windows-arm64.exe
115
146
  ```
116
147
 
148
+ </details>
149
+
117
150
  **ソースから**
118
151
 
119
152
  ```bash
package/README.ko-KR.md CHANGED
@@ -1,14 +1,29 @@
1
- <p align="center">
1
+ <div align="center">
2
2
  <a href="https://alibaba.github.io/open-code-review/">
3
- <img src="imgs/logo.svg" alt="OpenCodeReview logo" width="240" height="240">
3
+ <img src="imgs/logo-core.svg" alt="OpenCodeReview logo" width="180" />
4
+ </a>
5
+ <h1>OpenCodeReview</h1>
6
+ </div>
7
+
8
+ <p align="center">
9
+ <a href="https://trendshift.io/repositories/41087" target="_blank">
10
+ <img src="https://trendshift.io/api/badge/trendshift/repositories/41087/weekly?language=Go" alt="alibaba%2Fopen-code-review | Trendshift" style="width: 320px; height: 70px;" width="320" height="70" />
4
11
  </a>
5
12
  </p>
6
- <p align="center">오픈 소스 AI 코드 리뷰 에이전트.</p>
7
13
  <p align="center">
8
14
  <a href="https://www.npmjs.com/package/@alibaba-group/open-code-review"><img alt="npm" src="https://img.shields.io/npm/v/@alibaba-group/open-code-review?style=flat-square" /></a>
9
15
  <a href="https://github.com/alibaba/open-code-review/actions/workflows/release.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/alibaba/open-code-review/release.yml?style=flat-square" /></a>
10
16
  <a href="https://goreportcard.com/report/github.com/alibaba/open-code-review"><img alt="Go Report Card" src="https://goreportcard.com/badge/github.com/alibaba/open-code-review?style=flat-square" /></a>
11
17
  <a href="https://github.com/alibaba/open-code-review/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/github/license/alibaba/open-code-review?style=flat-square" /></a>
18
+ <a href="https://deepwiki.com/alibaba/open-code-review"><img alt="Ask DeepWiki" src="https://deepwiki.com/badge.svg" /></a>
19
+ <a href="https://www.bestpractices.dev/projects/13328"><img alt="OpenSSF Best Practices" src="https://www.bestpractices.dev/projects/13328/badge" /></a>
20
+ </p>
21
+ <p align="center">
22
+ <a href="#supported-platforms"><img alt="Windows" src="https://img.shields.io/badge/Windows-supported-blue.svg" /></a>
23
+ <a href="#supported-platforms"><img alt="macOS" src="https://img.shields.io/badge/macOS-supported-blue.svg" /></a>
24
+ <a href="#supported-platforms"><img alt="Linux" src="https://img.shields.io/badge/Linux-supported-blue.svg" /></a>
25
+ <a href="#supported-agents"><img alt="Claude Code" src="https://img.shields.io/badge/Claude_Code-supported-blueviolet.svg" /></a>
26
+ <a href="#supported-agents"><img alt="Codex" src="https://img.shields.io/badge/Codex-supported-blueviolet.svg" /></a>
12
27
  </p>
13
28
  <p align="center">
14
29
  <a href="README.md">English</a> | <a href="README.zh-CN.md">简体中文</a> | <a href="README.ja-JP.md">日本語</a> | 한국어 | <a href="README.ru-RU.md">Русский</a>
@@ -88,7 +103,23 @@ npm install -g @alibaba-group/open-code-review
88
103
 
89
104
  **GitHub Release 사용**
90
105
 
91
- [GitHub Releases](https://github.com/alibaba/open-code-review/releases)에서 최신 binary를 다운로드합니다.
106
+ 명령 번으로 사용 중인 OS/아키텍처에 맞는 최신 binary를 설치합니다 (macOS / Linux):
107
+
108
+ ```bash
109
+ curl -fsSL https://raw.githubusercontent.com/alibaba/open-code-review/main/install.sh | sh
110
+ ```
111
+
112
+ 이 스크립트는 알맞은 릴리스 binary를 선택하고 SHA-256 체크섬을 검증한 뒤 `ocr`로 `/usr/local/bin`에 설치합니다. 설치 위치는 `OCR_INSTALL_DIR`로, 릴리스 버전은 `OCR_VERSION`으로 재정의할 수 있습니다:
113
+
114
+ ```bash
115
+ OCR_INSTALL_DIR="$HOME/.local/bin" OCR_VERSION=v1.3.13 \
116
+ sh -c "$(curl -fsSL https://raw.githubusercontent.com/alibaba/open-code-review/main/install.sh)"
117
+ ```
118
+
119
+ <details>
120
+ <summary>수동 다운로드 (Windows 포함 모든 플랫폼)</summary>
121
+
122
+ [GitHub Releases](https://github.com/alibaba/open-code-review/releases)에서 사용 중인 플랫폼의 binary를 다운로드합니다.
92
123
 
93
124
  ```bash
94
125
  # macOS (Apple Silicon)
@@ -114,6 +145,8 @@ curl -Lo ocr.exe https://github.com/alibaba/open-code-review/releases/latest/dow
114
145
  curl -Lo ocr.exe https://github.com/alibaba/open-code-review/releases/latest/download/opencodereview-windows-arm64.exe
115
146
  ```
116
147
 
148
+ </details>
149
+
117
150
  **소스에서 빌드**
118
151
 
119
152
  ```bash
package/README.md CHANGED
@@ -1,14 +1,29 @@
1
- <p align="center">
1
+ <div align="center">
2
2
  <a href="https://alibaba.github.io/open-code-review/">
3
- <img src="imgs/logo.svg" alt="OpenCodeReview logo" width="240" height="240">
3
+ <img src="imgs/logo-core.svg" alt="OpenCodeReview logo" width="180" />
4
+ </a>
5
+ <h1>OpenCodeReview</h1>
6
+ </div>
7
+
8
+ <p align="center">
9
+ <a href="https://trendshift.io/repositories/41087" target="_blank">
10
+ <img src="https://trendshift.io/api/badge/trendshift/repositories/41087/weekly?language=Go" alt="alibaba%2Fopen-code-review | Trendshift" style="width: 320px; height: 70px;" width="320" height="70" />
4
11
  </a>
5
12
  </p>
6
- <p align="center">The open source AI code review agent.</p>
7
13
  <p align="center">
8
14
  <a href="https://www.npmjs.com/package/@alibaba-group/open-code-review"><img alt="npm" src="https://img.shields.io/npm/v/@alibaba-group/open-code-review?style=flat-square" /></a>
9
15
  <a href="https://github.com/alibaba/open-code-review/actions/workflows/release.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/alibaba/open-code-review/release.yml?style=flat-square" /></a>
10
16
  <a href="https://goreportcard.com/report/github.com/alibaba/open-code-review"><img alt="Go Report Card" src="https://goreportcard.com/badge/github.com/alibaba/open-code-review?style=flat-square" /></a>
11
17
  <a href="https://github.com/alibaba/open-code-review/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/github/license/alibaba/open-code-review?style=flat-square" /></a>
18
+ <a href="https://deepwiki.com/alibaba/open-code-review"><img alt="Ask DeepWiki" src="https://deepwiki.com/badge.svg" /></a>
19
+ <a href="https://www.bestpractices.dev/projects/13328"><img alt="OpenSSF Best Practices" src="https://www.bestpractices.dev/projects/13328/badge" /></a>
20
+ </p>
21
+ <p align="center">
22
+ <a href="#supported-platforms"><img alt="Windows" src="https://img.shields.io/badge/Windows-supported-blue.svg" /></a>
23
+ <a href="#supported-platforms"><img alt="macOS" src="https://img.shields.io/badge/macOS-supported-blue.svg" /></a>
24
+ <a href="#supported-platforms"><img alt="Linux" src="https://img.shields.io/badge/Linux-supported-blue.svg" /></a>
25
+ <a href="#supported-agents"><img alt="Claude Code" src="https://img.shields.io/badge/Claude_Code-supported-blueviolet.svg" /></a>
26
+ <a href="#supported-agents"><img alt="Codex" src="https://img.shields.io/badge/Codex-supported-blueviolet.svg" /></a>
12
27
  </p>
13
28
  <p align="center">
14
29
  English | <a href="README.zh-CN.md">简体中文</a> | <a href="README.ja-JP.md">日本語</a> | <a href="README.ko-KR.md">한국어</a> | <a href="README.ru-RU.md">Русский</a>
@@ -33,8 +48,8 @@ A real-world code review benchmark built from **50** popular open-source reposit
33
48
  | Metric | What it measures | Why it matters |
34
49
  |--------|-----------------|----------------|
35
50
  | **F1** | Harmonic mean of precision and recall | Best single number for overall review quality |
36
- | **Precision** | % of reported issues that are real defects | Higher = fewer false alarms to triage |
37
- | **Recall** | % of real defects that are found | Higher = fewer issues slip through review |
51
+ | **Precision** | Proportion of reported issues that are real defects | Higher = fewer false alarms to triage |
52
+ | **Recall** | Proportion of real defects that are found | Higher = fewer issues slip through review |
38
53
  | **Avg Time** | Wall-clock time per review | Matters for CI pipeline latency |
39
54
  | **Avg Token** | Total tokens consumed per review | Directly impacts API cost |
40
55
 
@@ -88,7 +103,23 @@ After installation, the `ocr` command is available globally.
88
103
 
89
104
  **From GitHub Release**
90
105
 
91
- Download the latest binary from [GitHub Releases](https://github.com/alibaba/open-code-review/releases):
106
+ Install the latest binary for your OS/architecture with one command (macOS / Linux):
107
+
108
+ ```bash
109
+ curl -fsSL https://raw.githubusercontent.com/alibaba/open-code-review/main/install.sh | sh
110
+ ```
111
+
112
+ The script picks the right release binary, verifies its SHA-256 checksum, and installs it as `ocr` in `/usr/local/bin`. Override the target with `OCR_INSTALL_DIR` or pin a release with `OCR_VERSION`:
113
+
114
+ ```bash
115
+ OCR_INSTALL_DIR="$HOME/.local/bin" OCR_VERSION=v1.3.13 \
116
+ sh -c "$(curl -fsSL https://raw.githubusercontent.com/alibaba/open-code-review/main/install.sh)"
117
+ ```
118
+
119
+ <details>
120
+ <summary>Manual download (all platforms, including Windows)</summary>
121
+
122
+ Download the binary for your platform from [GitHub Releases](https://github.com/alibaba/open-code-review/releases):
92
123
 
93
124
  ```bash
94
125
  # macOS (Apple Silicon)
@@ -114,6 +145,8 @@ curl -Lo ocr.exe https://github.com/alibaba/open-code-review/releases/latest/dow
114
145
  curl -Lo ocr.exe https://github.com/alibaba/open-code-review/releases/latest/download/opencodereview-windows-arm64.exe
115
146
  ```
116
147
 
148
+ </details>
149
+
117
150
  **From Source**
118
151
 
119
152
  ```bash
package/README.ru-RU.md CHANGED
@@ -1,14 +1,29 @@
1
- <p align="center">
1
+ <div align="center">
2
2
  <a href="https://alibaba.github.io/open-code-review/">
3
- <img src="imgs/logo.svg" alt="OpenCodeReview logo" width="240" height="240">
3
+ <img src="imgs/logo-core.svg" alt="OpenCodeReview logo" width="180" />
4
+ </a>
5
+ <h1>OpenCodeReview</h1>
6
+ </div>
7
+
8
+ <p align="center">
9
+ <a href="https://trendshift.io/repositories/41087" target="_blank">
10
+ <img src="https://trendshift.io/api/badge/trendshift/repositories/41087/weekly?language=Go" alt="alibaba%2Fopen-code-review | Trendshift" style="width: 320px; height: 70px;" width="320" height="70" />
4
11
  </a>
5
12
  </p>
6
- <p align="center">AI-агент код-ревью с открытым исходным кодом.</p>
7
13
  <p align="center">
8
14
  <a href="https://www.npmjs.com/package/@alibaba-group/open-code-review"><img alt="npm" src="https://img.shields.io/npm/v/@alibaba-group/open-code-review?style=flat-square" /></a>
9
15
  <a href="https://github.com/alibaba/open-code-review/actions/workflows/release.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/alibaba/open-code-review/release.yml?style=flat-square" /></a>
10
16
  <a href="https://goreportcard.com/report/github.com/alibaba/open-code-review"><img alt="Go Report Card" src="https://goreportcard.com/badge/github.com/alibaba/open-code-review?style=flat-square" /></a>
11
17
  <a href="https://github.com/alibaba/open-code-review/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/github/license/alibaba/open-code-review?style=flat-square" /></a>
18
+ <a href="https://deepwiki.com/alibaba/open-code-review"><img alt="Ask DeepWiki" src="https://deepwiki.com/badge.svg" /></a>
19
+ <a href="https://www.bestpractices.dev/projects/13328"><img alt="OpenSSF Best Practices" src="https://www.bestpractices.dev/projects/13328/badge" /></a>
20
+ </p>
21
+ <p align="center">
22
+ <a href="#supported-platforms"><img alt="Windows" src="https://img.shields.io/badge/Windows-supported-blue.svg" /></a>
23
+ <a href="#supported-platforms"><img alt="macOS" src="https://img.shields.io/badge/macOS-supported-blue.svg" /></a>
24
+ <a href="#supported-platforms"><img alt="Linux" src="https://img.shields.io/badge/Linux-supported-blue.svg" /></a>
25
+ <a href="#supported-agents"><img alt="Claude Code" src="https://img.shields.io/badge/Claude_Code-supported-blueviolet.svg" /></a>
26
+ <a href="#supported-agents"><img alt="Codex" src="https://img.shields.io/badge/Codex-supported-blueviolet.svg" /></a>
12
27
  </p>
13
28
  <p align="center">
14
29
  <a href="README.md">English</a> | <a href="README.zh-CN.md">简体中文</a> | <a href="README.ja-JP.md">日本語</a> | <a href="README.ko-KR.md">한국어</a> | Русский
@@ -33,8 +48,8 @@ Open Code Review — это CLI-инструмент для код-ревью н
33
48
  | Метрика | Что измеряет | Почему важна |
34
49
  |---------|-------------|--------------|
35
50
  | **F1** | Гармоническое среднее precision и recall | Лучший единый показатель качества ревью |
36
- | **Precision** | % найденных проблем, являющихся реальными дефектами | Выше = меньше ложных срабатываний |
37
- | **Recall** | % реальных дефектов, которые были найдены | Выше = меньше пропущенных проблем |
51
+ | **Precision** | Доля найденных проблем, являющихся реальными дефектами | Выше = меньше ложных срабатываний |
52
+ | **Recall** | Доля реальных дефектов, которые были найдены | Выше = меньше пропущенных проблем |
38
53
  | **Avg Time** | Время выполнения одного ревью | Влияет на задержки в CI-пайплайне |
39
54
  | **Avg Token** | Суммарное потребление токенов за ревью | Прямо влияет на стоимость API |
40
55
 
@@ -88,7 +103,23 @@ npm install -g @alibaba-group/open-code-review
88
103
 
89
104
  **Из GitHub Release**
90
105
 
91
- Скачайте свежий бинарный файл со страницы [GitHub Releases](https://github.com/alibaba/open-code-review/releases):
106
+ Установите свежий бинарный файл для вашей ОС/архитектуры одной командой (macOS / Linux):
107
+
108
+ ```bash
109
+ curl -fsSL https://raw.githubusercontent.com/alibaba/open-code-review/main/install.sh | sh
110
+ ```
111
+
112
+ Скрипт сам выбирает подходящий бинарный файл релиза, проверяет его контрольную сумму SHA-256 и устанавливает его как `ocr` в `/usr/local/bin`. Каталог установки можно переопределить через `OCR_INSTALL_DIR`, а версию релиза зафиксировать через `OCR_VERSION`:
113
+
114
+ ```bash
115
+ OCR_INSTALL_DIR="$HOME/.local/bin" OCR_VERSION=v1.3.13 \
116
+ sh -c "$(curl -fsSL https://raw.githubusercontent.com/alibaba/open-code-review/main/install.sh)"
117
+ ```
118
+
119
+ <details>
120
+ <summary>Ручная загрузка (все платформы, включая Windows)</summary>
121
+
122
+ Скачайте бинарный файл для вашей платформы со страницы [GitHub Releases](https://github.com/alibaba/open-code-review/releases):
92
123
 
93
124
  ```bash
94
125
  # macOS (Apple Silicon)
@@ -114,6 +145,8 @@ curl -Lo ocr.exe https://github.com/alibaba/open-code-review/releases/latest/dow
114
145
  curl -Lo ocr.exe https://github.com/alibaba/open-code-review/releases/latest/download/opencodereview-windows-arm64.exe
115
146
  ```
116
147
 
148
+ </details>
149
+
117
150
  **Из исходников**
118
151
 
119
152
  ```bash
package/README.zh-CN.md CHANGED
@@ -1,14 +1,29 @@
1
- <p align="center">
1
+ <div align="center">
2
2
  <a href="https://alibaba.github.io/open-code-review/">
3
- <img src="imgs/logo.svg" alt="OpenCodeReview logo" width="240" height="240">
3
+ <img src="imgs/logo-core.svg" alt="OpenCodeReview logo" width="180" />
4
+ </a>
5
+ <h1>OpenCodeReview</h1>
6
+ </div>
7
+
8
+ <p align="center">
9
+ <a href="https://trendshift.io/repositories/41087" target="_blank">
10
+ <img src="https://trendshift.io/api/badge/trendshift/repositories/41087/weekly?language=Go" alt="alibaba%2Fopen-code-review | Trendshift" style="width: 320px; height: 70px;" width="320" height="70" />
4
11
  </a>
5
12
  </p>
6
- <p align="center">The open source AI code review agent.</p>
7
13
  <p align="center">
8
14
  <a href="https://www.npmjs.com/package/@alibaba-group/open-code-review"><img alt="npm" src="https://img.shields.io/npm/v/@alibaba-group/open-code-review?style=flat-square" /></a>
9
15
  <a href="https://github.com/alibaba/open-code-review/actions/workflows/release.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/alibaba/open-code-review/release.yml?style=flat-square" /></a>
10
16
  <a href="https://goreportcard.com/report/github.com/alibaba/open-code-review"><img alt="Go Report Card" src="https://goreportcard.com/badge/github.com/alibaba/open-code-review?style=flat-square" /></a>
11
17
  <a href="https://github.com/alibaba/open-code-review/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/github/license/alibaba/open-code-review?style=flat-square" /></a>
18
+ <a href="https://deepwiki.com/alibaba/open-code-review"><img alt="Ask DeepWiki" src="https://deepwiki.com/badge.svg" /></a>
19
+ <a href="https://www.bestpractices.dev/projects/13328"><img alt="OpenSSF Best Practices" src="https://www.bestpractices.dev/projects/13328/badge" /></a>
20
+ </p>
21
+ <p align="center">
22
+ <a href="#supported-platforms"><img alt="Windows" src="https://img.shields.io/badge/Windows-supported-blue.svg" /></a>
23
+ <a href="#supported-platforms"><img alt="macOS" src="https://img.shields.io/badge/macOS-supported-blue.svg" /></a>
24
+ <a href="#supported-platforms"><img alt="Linux" src="https://img.shields.io/badge/Linux-supported-blue.svg" /></a>
25
+ <a href="#supported-agents"><img alt="Claude Code" src="https://img.shields.io/badge/Claude_Code-supported-blueviolet.svg" /></a>
26
+ <a href="#supported-agents"><img alt="Codex" src="https://img.shields.io/badge/Codex-supported-blueviolet.svg" /></a>
12
27
  </p>
13
28
  <p align="center">
14
29
  <a href="README.md">English</a> | 简体中文 | <a href="README.ja-JP.md">日本語</a> | <a href="README.ko-KR.md">한국어</a> | <a href="README.ru-RU.md">Русский</a>
@@ -88,7 +103,23 @@ npm install -g @alibaba-group/open-code-review
88
103
 
89
104
  **从 GitHub Release 下载**
90
105
 
91
- [GitHub Releases](https://github.com/alibaba/open-code-review/releases) 下载最新二进制文件:
106
+ 使用一条命令为你的操作系统/架构安装最新二进制文件(macOS / Linux):
107
+
108
+ ```bash
109
+ curl -fsSL https://raw.githubusercontent.com/alibaba/open-code-review/main/install.sh | sh
110
+ ```
111
+
112
+ 该脚本会自动选择匹配的发布二进制文件,校验其 SHA-256 校验和,并将其作为 `ocr` 安装到 `/usr/local/bin`。可通过 `OCR_INSTALL_DIR` 覆盖安装目录,或通过 `OCR_VERSION` 指定发布版本:
113
+
114
+ ```bash
115
+ OCR_INSTALL_DIR="$HOME/.local/bin" OCR_VERSION=v1.3.13 \
116
+ sh -c "$(curl -fsSL https://raw.githubusercontent.com/alibaba/open-code-review/main/install.sh)"
117
+ ```
118
+
119
+ <details>
120
+ <summary>手动下载(所有平台,包括 Windows)</summary>
121
+
122
+ 从 [GitHub Releases](https://github.com/alibaba/open-code-review/releases) 下载适用于你平台的二进制文件:
92
123
 
93
124
  ```bash
94
125
  # macOS (Apple Silicon)
@@ -114,6 +145,8 @@ curl -Lo ocr.exe https://github.com/alibaba/open-code-review/releases/latest/dow
114
145
  curl -Lo ocr.exe https://github.com/alibaba/open-code-review/releases/latest/download/opencodereview-windows-arm64.exe
115
146
  ```
116
147
 
148
+ </details>
149
+
117
150
  **从源码构建**
118
151
 
119
152
  ```bash
package/bin/ocr.js CHANGED
@@ -17,6 +17,17 @@ if (!resolved) {
17
17
  }
18
18
  const binaryPath = resolved.path;
19
19
 
20
+ const hintFile = path.join(os.homedir(), ".opencodereview", "update-available");
21
+ try {
22
+ const hint = JSON.parse(fs.readFileSync(hintFile, "utf8"));
23
+ if (hint.version && hint.pkg) {
24
+ console.error(
25
+ `\x1b[33m[ocr] A new version (v${hint.version}) is available. Run to update:\x1b[0m\n` +
26
+ `\x1b[33m npm i -g ${hint.pkg}@${hint.version}\x1b[0m\n`
27
+ );
28
+ }
29
+ } catch (_) {}
30
+
20
31
  if (!process.env.OCR_NO_UPDATE) {
21
32
  const stateDir = path.join(os.homedir(), ".opencodereview");
22
33
  const tsFile = path.join(stateDir, "last-update-check");
Binary file
Binary file
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="500" height="500" viewBox="0 0 500 500"><defs><clipPath id="master_svg0_3_1846"><rect x="0" y="0" width="500" height="500" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_3_1846)"><path d="M369.391824777832,207.16971852783203L369.391854777832,131.60131852783203C369.391854777832,128.15557852783203,367.18552477783203,125.09696952783203,363.915744777832,124.00987252783203L265.002354777832,91.12426762783203C256.809764777832,88.40048217783203,247.95578477783204,88.40048217783203,239.76320477783204,91.12426762783203L140.84986477783204,124.00987252783203C137.58010877783204,125.09696952783203,135.37377977783203,128.15557852783203,135.37377977783203,131.60131052783203L135.37377977783203,187.979896527832Q110.36145377783203,206.39992852783203,91.91033172783203,231.29782852783202C91.25267028783203,232.18527852783203,91.45416259783204,233.43310852783202,92.34779357783204,234.08234852783204L101.33021547783203,240.60814852783204C102.22384677783204,241.25737852783203,103.48256677783203,241.04652852783204,104.14099877783204,240.15965852783202Q117.80681777783204,221.75247852783204,135.37377977783203,207.15375852783203L135.37377977783203,207.16845852783203C135.42538077783203,207.12065852783203,135.47701677783203,207.07290852783203,135.52869377783202,207.02515852783205Q150.71423377783202,194.43231852783202,168.80918877783205,184.679801527832Q209.221374777832,162.89910852783203,251.50217477783204,162.39883452783204C251.59465477783203,162.39774352783203,251.68558477783202,162.39046452783202,251.77458477783202,162.377410527832C251.97704477783202,162.37673952783203,252.17955477783204,162.37640352783203,252.38211477783204,162.37640352783203C296.51404477783205,162.37640352783203,338.303324777832,178.37404652783204,369.391824777832,207.16971852783203ZM252.38291477783204,295.414878527832C279.10971477783204,295.414878527832,300.776084777832,273.74850852783203,300.776084777832,247.02170852783203C300.776084777832,240.21207852783203,299.33893477783204,233.47909852783204,296.55858477783204,227.26292852783203C294.66187477783205,235.80182852783204,287.548164777832,242.19144852783202,278.85541477783204,243.16412852783202C279.03736477783207,244.42372852783203,279.131504777832,245.71170852783203,279.131504777832,247.02168852783203C279.131504777832,261.794608527832,267.155694777832,273.770428527832,252.38277477783203,273.770428527832C237.60985477783203,273.770428527832,225.63404477783203,261.794608527832,225.63404477783203,247.02168852783203C225.63404477783203,232.24876852783203,237.60985477783203,220.27295852783203,252.38277477783203,220.27295852783203C253.69280477783204,220.27295852783203,254.98084477783203,220.36711852783202,256.240474777832,220.54907852783202C257.21321477783204,211.85636852783205,263.60280477783203,204.742728527832,272.141634777832,202.84602852783203C265.925484777832,200.06567852783203,259.19254477783204,198.62853852783203,252.38291477783204,198.62853852783203C225.65610477783204,198.62853852783203,203.98974477783202,220.29489852783203,203.98974477783202,247.02170852783203C203.98974477783202,273.74850852783203,225.65610477783204,295.414878527832,252.38291477783204,295.414878527832ZM274.81439477783204,243.21481852783202C264.90529477783207,242.35698852783204,257.04755477783203,234.49919852783202,256.1897847778321,224.59009852783203C254.95186477783204,224.38151852783204,253.68000477783204,224.27295852783203,252.38277477783203,224.27295852783203C239.81899477783202,224.27295852783203,229.63404477783203,234.45790852783202,229.63404477783203,247.02168852783203C229.63404477783203,259.58546852783206,239.81899477783202,269.770428527832,252.38277477783203,269.770428527832C264.94655477783203,269.770428527832,275.131504777832,259.58546852783206,275.131504777832,247.02168852783203C275.131504777832,245.72450852783203,275.02294477783204,244.45268852783204,274.81439477783204,243.21481852783202ZM313.98419477783204,373.06705852783205C339.51094477783204,356.76340852783204,357.58451477783206,331.66420852783205,365.26810477783204,303.12996852783203Q389.75952477783204,285.49681852783203,408.076424777832,260.794778527832C408.73435477783204,259.907508527832,408.54584477783203,258.641948527832,407.65219477783205,257.99271852783204L398.669774777832,251.46689852783203C397.77616477783204,250.81766852783204,396.535404777832,251.00403852783202,395.87693477783205,251.89087852783203Q383.89679477783204,268.02557852783207,369.057804777832,280.89197852783207L369.05826477783205,280.88595852783203C369.02341477783204,280.91804852783207,368.98856477783204,280.950138527832,368.95362477783203,280.98224852783204Q352.70179477783205,295.05160852783206,333.025454777832,305.20590852783204Q296.652744777832,323.976658527832,256.24428477783204,325.33029852783204C254.95902477783204,325.35753852783205,253.67157477783203,325.37118852783203,252.38211477783204,325.37118852783203C208.41640477783204,325.37118852783203,166.76860077783203,309.49237852783205,135.70742077783203,280.88730852783203C138.50842277783204,318.39349852783204,158.79284677783204,352.636328527832,190.78138777783204,373.067088527832L248.07660477783202,409.660928527832C250.70246477783203,411.33801852783205,254.06308477783202,411.33801852783205,256.68894477783203,409.660928527832L313.98419477783204,373.06705852783205Z" fill-rule="evenodd" fill="#35BD5F" fill-opacity="1"/></g></svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alibaba-group/open-code-review",
3
- "version": "1.4.1",
3
+ "version": "1.4.4",
4
4
  "description": "OpenCodeReview CLI — AI-powered code review tool",
5
5
  "bin": {
6
6
  "ocr": "bin/ocr.js"
@@ -28,12 +28,12 @@
28
28
  "checksumPattern": "https://github.com/alibaba/open-code-review/releases/download/v{version}/sha256sum.txt"
29
29
  },
30
30
  "optionalDependencies": {
31
- "@alibaba-group/ocr-darwin-arm64": "1.4.1",
32
- "@alibaba-group/ocr-darwin-x64": "1.4.1",
33
- "@alibaba-group/ocr-linux-arm64": "1.4.1",
34
- "@alibaba-group/ocr-linux-x64": "1.4.1",
35
- "@alibaba-group/ocr-win32-arm64": "1.4.1",
36
- "@alibaba-group/ocr-win32-x64": "1.4.1"
31
+ "@alibaba-group/ocr-darwin-arm64": "1.4.4",
32
+ "@alibaba-group/ocr-darwin-x64": "1.4.4",
33
+ "@alibaba-group/ocr-linux-arm64": "1.4.4",
34
+ "@alibaba-group/ocr-linux-x64": "1.4.4",
35
+ "@alibaba-group/ocr-win32-arm64": "1.4.4",
36
+ "@alibaba-group/ocr-win32-x64": "1.4.4"
37
37
  },
38
38
  "engines": {
39
39
  "node": ">=14"
package/scripts/update.js CHANGED
@@ -7,22 +7,13 @@ const os = require("os");
7
7
  const https = require("https");
8
8
  const { spawnSync } = require("child_process");
9
9
 
10
- const {
11
- IS_WINDOWS,
12
- BINARY_NAME,
13
- detectPlatform,
14
- loadPackageJson,
15
- buildUrl,
16
- downloadText,
17
- downloadBinary,
18
- computeChecksum,
19
- } = require("./install.js");
20
- const packageRoot = path.join(__dirname, "..");
21
- const binDir = path.join(packageRoot, "bin");
22
- const binaryPath = path.join(binDir, BINARY_NAME);
10
+ const { resolveNativeBinary } = require("./platform");
11
+ const { loadPackageJson } = require("./install.js");
12
+
23
13
  const stateDir = path.join(os.homedir(), ".opencodereview");
24
14
  const tsFile = path.join(stateDir, "last-update-check");
25
15
  const lockFile = path.join(stateDir, "update.lock");
16
+ const hintFile = path.join(stateDir, "update-available");
26
17
 
27
18
  const DEFAULT_REGISTRY = "https://registry.npmjs.org";
28
19
 
@@ -65,9 +56,9 @@ function releaseLock() {
65
56
  } catch (_) {}
66
57
  }
67
58
 
68
- function getInstalledVersion() {
59
+ function getInstalledVersion(binPath) {
69
60
  try {
70
- const result = spawnSync(binaryPath, ["version"], {
61
+ const result = spawnSync(binPath, ["version"], {
71
62
  encoding: "utf8",
72
63
  timeout: 3000,
73
64
  });
@@ -118,24 +109,30 @@ function fetchLatestVersion(pkg) {
118
109
  });
119
110
  }
120
111
 
112
+ const SEMVER_RE = /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/;
113
+
121
114
  function semverGt(a, b) {
122
- const pa = a.split(".").map(Number);
123
- const pb = b.split(".").map(Number);
115
+ const pa = a.replace(/-.*$/, "").split(".").map(Number);
116
+ const pb = b.replace(/-.*$/, "").split(".").map(Number);
124
117
  for (let i = 0; i < 3; i++) {
125
118
  if ((pa[i] || 0) > (pb[i] || 0)) return true;
126
119
  if ((pa[i] || 0) < (pb[i] || 0)) return false;
127
120
  }
121
+ const aPre = a.includes("-");
122
+ const bPre = b.includes("-");
123
+ if (bPre && !aPre) return true;
128
124
  return false;
129
125
  }
130
126
 
131
- function cleanupTemp() {
127
+ function writeHint(latestVersion, pkgName) {
132
128
  try {
133
- const files = fs.readdirSync(binDir);
134
- for (const f of files) {
135
- if (f.startsWith(".opencodereview.tmp.")) {
136
- fs.unlinkSync(path.join(binDir, f));
137
- }
138
- }
129
+ fs.writeFileSync(hintFile, JSON.stringify({ version: latestVersion, pkg: pkgName }));
130
+ } catch (_) {}
131
+ }
132
+
133
+ function removeHint() {
134
+ try {
135
+ fs.unlinkSync(hintFile);
139
136
  } catch (_) {}
140
137
  }
141
138
 
@@ -144,97 +141,38 @@ async function main() {
144
141
 
145
142
  if (!acquireLock()) return;
146
143
 
147
- cleanupTemp();
148
-
149
144
  try {
150
- const { resolveNativeBinary } = require("./platform");
151
145
  const resolved = resolveNativeBinary();
152
- if (resolved && resolved.fromPlatformPkg) {
153
- info("Binary managed by platform package, skipping auto-update.");
154
- return;
155
- }
156
- const installedVersion = getInstalledVersion();
146
+ if (!resolved) return;
147
+
148
+ const installedVersion = getInstalledVersion(resolved.path);
157
149
  if (!installedVersion) return;
158
150
 
159
151
  const pkg = loadPackageJson();
160
152
  const latestVersion = await fetchLatestVersion(pkg);
161
153
  if (!latestVersion) return;
162
154
 
163
- if (!semverGt(latestVersion, installedVersion)) return;
164
-
165
- const { os: platform, arch } = detectPlatform();
166
- const config = pkg.ocrConfig;
155
+ if (!SEMVER_RE.test(latestVersion)) return;
167
156
 
168
- const vars = { version: latestVersion, os: platform, arch };
169
- let downloadUrl = buildUrl(config.urlPattern, vars);
170
- if (IS_WINDOWS) {
171
- downloadUrl += ".exe";
172
- }
173
-
174
- const tempPath = path.join(binDir, `.opencodereview.tmp.${process.pid}`);
175
- await downloadBinary(downloadUrl, tempPath);
176
- if (!IS_WINDOWS) {
177
- fs.chmodSync(tempPath, 0o755);
157
+ if (!semverGt(latestVersion, installedVersion)) {
158
+ removeHint();
159
+ return;
178
160
  }
179
161
 
180
- if (config.checksumPattern) {
181
- const checksumUrl = buildUrl(config.checksumPattern, vars);
182
- let shaContent;
183
- try {
184
- shaContent = await downloadText(checksumUrl);
185
- } catch (_) {
186
- fs.unlinkSync(tempPath);
187
- return;
188
- }
189
- let actualSha;
190
- try {
191
- actualSha = await computeChecksum(tempPath);
192
- } catch (_) {
193
- fs.unlinkSync(tempPath);
194
- return;
195
- }
196
-
197
- let verified = false;
198
- for (const line of shaContent.split("\n")) {
199
- const trimmed = line.trim();
200
- if (trimmed.includes(`-${platform}-${arch}`)) {
201
- const expectedSha = trimmed.split(/\s+/)[0].toLowerCase();
202
- if (expectedSha && actualSha !== expectedSha) {
203
- fs.unlinkSync(tempPath);
204
- return;
205
- }
206
- verified = true;
207
- break;
208
- }
209
- }
210
- if (!verified) {
211
- fs.unlinkSync(tempPath);
212
- return;
213
- }
214
- }
162
+ const pkgName = pkg.name;
163
+ const IS_WINDOWS = process.platform === "win32";
164
+ const result = spawnSync("npm", ["i", "-g", `${pkgName}@${latestVersion}`], {
165
+ encoding: "utf8",
166
+ timeout: 120000,
167
+ shell: IS_WINDOWS,
168
+ });
215
169
 
216
- if (IS_WINDOWS) {
217
- const oldPath = binaryPath + ".old";
218
- try { fs.unlinkSync(oldPath); } catch (_) {}
219
- try {
220
- fs.renameSync(binaryPath, oldPath);
221
- } catch (e) {
222
- if (fs.existsSync(binaryPath)) {
223
- throw e;
224
- }
225
- }
226
- try {
227
- fs.renameSync(tempPath, binaryPath);
228
- } catch (e) {
229
- try { fs.renameSync(oldPath, binaryPath); } catch (_) {}
230
- throw e;
231
- }
232
- try { fs.unlinkSync(oldPath); } catch (_) {}
170
+ if (result.status === 0) {
171
+ removeHint();
233
172
  } else {
234
- fs.renameSync(tempPath, binaryPath);
173
+ writeHint(latestVersion, pkgName);
235
174
  }
236
175
  } catch (_) {
237
- cleanupTemp();
238
176
  } finally {
239
177
  releaseLock();
240
178
  }