coderev-cli 1.0.3 → 1.0.5

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.
Files changed (2) hide show
  1. package/README.md +71 -68
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # coderev-cli
2
2
 
3
- > Multi-agent AI code review for git parallel Security / Bug / Quality agents with confidence scoring.
3
+ > 多智能体 AI 代码审查工具 — Security / Bug / Quality 三个 Agent 并行审查,带置信度评分。
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/coderev-cli)](https://www.npmjs.com/package/coderev-cli)
6
6
 
7
7
  ---
8
8
 
9
- ## Install
9
+ ## 安装
10
10
 
11
11
  ```bash
12
12
  npm install -g coderev-cli
@@ -14,114 +14,117 @@ npm install -g coderev-cli
14
14
 
15
15
  ---
16
16
 
17
- ## Quick Start
17
+ ## 快速上手
18
18
 
19
19
  ```bash
20
- # 1. init project config
20
+ # 1. 初始化项目配置
21
21
  coderev init
22
22
 
23
- # 2. set API key (supports DeepSeek / OpenAI)
24
- export DEEPSEEK_API_KEY="sk-xxx"
23
+ # 2. 设置 API Key(支持 DeepSeek / OpenAI
24
+ # Linux / macOS:
25
+ export DEEPSEEK_API_KEY="***"
26
+ # Windows PowerShell:
27
+ $env:DEEPSEEK_API_KEY="***"
25
28
 
26
- # 3. review staged changes
29
+ # 3. 审查暂存区变更
27
30
  coderev review
28
31
 
29
- # 4. or review a diff
32
+ # 4. 或传入 git diff
30
33
  git diff main | coderev review
31
34
 
32
- # 5. or review a PR
35
+ # 5. 或审查 PR
33
36
  coderev review --pr owner/repo#42
34
37
  ```
35
38
 
36
39
  ---
37
40
 
38
- ## Architecture
41
+ ## 架构
39
42
 
40
43
  ```
41
- your code (git diff)
44
+ 你的代码 (git diff)
42
45
 
43
46
  ┌──────┼──────┐
44
47
  ▼ ▼ ▼
45
48
  ┌──────┐┌──────┐┌──────┐
46
49
  │ 🔒 ││ 🐛 ││ 📐 │
47
- Security│ BugQuality│
48
- Auditor│Detector│ Check
50
+ 安全 ││ 缺陷 ││ 质量
51
+ 审计 ││ 检测 ││ 检查
49
52
  └──┬───┘└──┬───┘└──┬───┘
50
53
  │ │ │
51
54
  └───────┼───────┘
52
55
 
53
56
  ┌──────────┐
54
- merge &
55
- confidence
57
+ 合并 &
58
+ 置信度评分
56
59
  │ (0-100) │
57
60
  └────┬─────┘
58
61
 
59
- structured report
62
+ 结构化审查报告
60
63
  ```
61
64
 
62
- | Agent | Focus |
63
- |-------|-------|
64
- | 🔒 Security Audit | SQL injection, XSS, SSRF, hardcoded secrets, auth flaws |
65
- | 🐛 Bug Detection | null pointers, race conditions, async issues, logic errors |
66
- | 📐 Code Quality | complexity, DRY, naming, exception handling |
65
+ | Agent | 专注领域 |
66
+ |-------|---------|
67
+ | 🔒 安全审计 | SQL注入、XSSSSRF、硬编码密钥、认证缺陷 |
68
+ | 🐛 缺陷检测 | 空指针、竞态条件、异步问题、逻辑错误 |
69
+ | 📐 质量检查 | 代码复杂度、DRY、命名规范、异常处理 |
67
70
 
68
- Every issue gets a **confidence score (0100)**; below threshold (default 60) is auto-filtered. Duplicates found by multiple agents are merged.
71
+ 每个 issue 附带**置信度评分 (0-100)**,低于阈值(默认 60)自动过滤。多 Agent 发现的重复问题自动合并去重。
69
72
 
70
73
  ---
71
74
 
72
- ## CLI Reference
75
+ ## CLI 命令参考
73
76
 
74
77
  ### review
75
78
 
76
79
  ```bash
77
- coderev review # parallel agents (default)
78
- coderev review --min-confidence 80 # higher bar, fewer false positives
79
- coderev review --single # single agent mode (v0.2 compat, cheaper)
80
- coderev review --audit # OWASP-level security focus
81
- coderev review --no-cache # bypass cache
82
- coderev review --format json # JSON output
80
+ coderev review # Agent 并行审查(默认)
81
+ coderev review --min-confidence 80 # 提高阈值,减少误报
82
+ coderev review --single # Agent 模式(v0.2 兼容,更省)
83
+ coderev review --audit # 安全审计模式(OWASP 级)
84
+ coderev review --no-cache # 跳过缓存
85
+ coderev review --format json # JSON 输出
83
86
  ```
84
87
 
85
88
  ### fix
86
89
 
87
90
  ```bash
88
- coderev fix --file changes.diff # auto-fix suggestions
89
- coderev fix --file changes.diff --apply # generate & apply patches
91
+ coderev fix --file changes.diff # 自动修复建议
92
+ coderev fix --file changes.diff --apply # 生成并应用补丁
90
93
  ```
91
94
 
92
- ### PR review
95
+ ### PR 审查
93
96
 
94
97
  ```bash
95
- coderev review --pr owner/repo#42 # review external PR
96
- coderev review --pr 42 # auto-detect current repo
97
- coderev review --pr owner/repo#42 --post # review + post comment
98
- coderev review --pr owner/repo#42 --inline # inline code comments
98
+ coderev review --pr owner/repo#42 # 审查外部 PR
99
+ coderev review --pr 42 # 自动检测当前仓库
100
+ coderev review --pr owner/repo#42 --post # 审查 + 贴评论
101
+ coderev review --pr owner/repo#42 --inline # 行内评论
99
102
  coderev review --pr owner/repo#42 --format json
100
103
  ```
101
104
 
102
- ### hooks
105
+ ### Git Hooks
103
106
 
104
107
  ```bash
105
- coderev hook install # install pre-commit hook
108
+ coderev hook install # 安装 pre-commit
106
109
  coderev hook install pre-commit --min-score 70
107
110
  coderev hook install pre-push
108
111
  ```
109
112
 
110
- ### other
113
+ ### 其他
111
114
 
112
115
  ```bash
113
- coderev stats # dashboard
114
- coderev stats week # weekly stats
115
- coderev cache status # cache info
116
- coderev cache clear # clear cache
117
- coderev config show # show config
116
+ coderev stats # 统计看板
117
+ coderev stats week # 本周统计
118
+ coderev cache status # 缓存状态
119
+ coderev cache clear # 清空缓存
120
+ coderev config show # 查看配置
118
121
  ```
119
122
 
120
123
  ---
121
124
 
122
- ## Config
125
+ ## 配置管理
123
126
 
124
- Create `.coderevrc.json` in project root:
127
+ 在项目根目录创建 `.coderevrc.json`:
125
128
 
126
129
  ```json
127
130
  {
@@ -137,62 +140,62 @@ Create `.coderevrc.json` in project root:
137
140
  {
138
141
  "name": "no-console-log",
139
142
  "severity": "warning",
140
- "message": "avoid console.log in production code"
143
+ "message": "避免在生产代码中使用 console.log"
141
144
  }
142
145
  ]
143
146
  }
144
147
  }
145
148
  ```
146
149
 
147
- Supports 8 built-in rule sets and language-specific rules for JS, TS, Python, Rust, Go, Java, SQL.
150
+ 内置 8 套预定义规则集,并支持 JS / TS / Python / Rust / Go / Java / SQL 语言专项规则。
148
151
 
149
152
  ### .coderevhint
150
153
 
151
- Describe your project context. coderev reads it during review to tailor analysis. Compatible with `CLAUDE.md`.
154
+ 项目上下文描述文件。AI 审查时自动加载并据此调整分析重点。兼容 `CLAUDE.md`。
152
155
 
153
156
  ---
154
157
 
155
- ## Git Platform Support
158
+ ## 支持的 Git 平台
156
159
 
157
- | Platform | PR review | Comment posting |
158
- |----------|-----------|-----------------|
159
- | GitHub | ✅ | ✅ inline / summary |
160
- | GitLab | ✅ | ✅ |
161
- | Gitee | ✅ | ✅ |
162
- | Bitbucket| ✅ | ✅ |
160
+ | 平台 | PR 审查 | 评论回贴 |
161
+ |------|---------|---------|
162
+ | GitHub | ✅ | ✅ 行内 / 摘要 |
163
+ | GitLab | ✅ | ✅ |
164
+ | Gitee | ✅ | ✅ |
165
+ | Bitbucket | ✅ | ✅ |
163
166
 
164
167
  ---
165
168
 
166
- ## Caching
169
+ ## 缓存
167
170
 
168
- - SHA256-based diff hashing
169
- - 24-hour TTL
171
+ - SHA256 摘要哈希
172
+ - 24 小时 TTL
170
173
  - `coderev cache status` / `coderev cache clear`
171
174
 
172
175
  ---
173
176
 
174
177
  ## CI / GitHub Actions
175
178
 
176
- Built-in workflow at `.github/workflows/coderev-review.yml` — auto-reviews every PR.
179
+ 内置工作流文件 `.github/workflows/coderev-review.yml`,PR 自动审查。
177
180
 
178
181
  ---
179
182
 
180
- ## Project Structure
183
+ ## 项目结构
181
184
 
182
185
  ```
183
186
  coderev/
184
187
  ├── src/
185
- │ ├── cli.js # CLI entry
186
- │ ├── reviewer.js # multi-agent review core
187
- │ ├── config.js # config loader
188
+ │ ├── cli.js # CLI 入口
189
+ │ ├── reviewer.js # Agent 审查核心
190
+ │ ├── config.js # 配置加载
188
191
  │ ├── github.js # GitHub API
189
192
  │ ├── gitlab.js # GitLab API
190
193
  │ ├── gitee.js # Gitee API
191
194
  │ ├── bitbucket.js # Bitbucket API
192
- │ ├── cache.js # caching
193
- │ ├── rules.js # rule engine
194
- │ ├── stats.js # dashboard
195
- │ └── coderev.test.js # 20 tests
195
+ │ ├── cache.js # 缓存系统
196
+ │ ├── rules.js # 规则引擎
197
+ │ ├── stats.js # 统计看板
198
+ │ └── coderev.test.js # 20 个单元测试
196
199
  ├── .github/workflows/
197
200
  ├── .coderevrc.json
198
201
  ├── .coderevignore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coderev-cli",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Multi-agent AI code review for git -- parallel agents with confidence scoring",
5
5
  "main": "src/index.js",
6
6
  "bin": {