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