@vocvx/aiv-cli 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +83 -2
- package/aiv.mjs +1274 -0
- package/package.json +38 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AIV (AI Verification Platform)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,84 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @vocvx/aiv-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
AI Verification Platform 的命令行工具:**一条命令跑完「解析需求 → 自动验证 → 生成报告 → 导出 PDF」**,
|
|
4
|
+
也可以查报告树、影响面、知识库检索结果。只通过 HTTP 与平台交互,不直连数据库、不在本地跑浏览器。
|
|
5
|
+
|
|
6
|
+
- 平台:<https://aiv.vocvx.com>
|
|
7
|
+
- 文档:[USAGE-CLI.md](https://github.com/mengshuqiang/AIV/blob/main/USAGE-CLI.md) · [DEPLOY-CLI.md](https://github.com/mengshuqiang/AIV/blob/main/DEPLOY-CLI.md)
|
|
8
|
+
|
|
9
|
+
## 安装
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm i -g @vocvx/aiv-cli
|
|
13
|
+
aiv --version
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
要求 Node.js ≥ 18。
|
|
17
|
+
|
|
18
|
+
## 登录
|
|
19
|
+
|
|
20
|
+
三种方式,任选其一(Token 存在 `~/.aiv/config.json`,权限 600):
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# 1) 手机号 + 短信验证码(与网页同一套账号,赠送额度一致)
|
|
24
|
+
aiv login --server https://aiv.vocvx.com --phone 13800001234
|
|
25
|
+
|
|
26
|
+
# 2) 网页端生成的登录码(10 分钟有效,适合 CI)
|
|
27
|
+
aiv login --server https://aiv.vocvx.com --code ABCD-1234
|
|
28
|
+
|
|
29
|
+
# 3) 平台发放的 API Token(账户中心 → API Token)
|
|
30
|
+
aiv login --server https://aiv.vocvx.com --token aiv_xxx
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
也可以完全用环境变量,不落盘:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
export AIV_API_URL=https://aiv.vocvx.com
|
|
37
|
+
export AIV_API_TOKEN=aiv_xxx
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 上手三步
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
cd /path/to/your-repo # 在有源码的仓库里执行,aiv 会自动识别项目与本地地址
|
|
44
|
+
|
|
45
|
+
aiv init # 绑定项目:探测本地服务地址/源码路径,写入 .aiv.json
|
|
46
|
+
aiv upload --file PRD.md --kind prd # 上传需求文档(UED 设计稿用 --kind ued)
|
|
47
|
+
aiv parse # 解析需求 → 保存 → 验证 → 报告落盘
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`aiv parse` 结束会打印结论与优先级摘要,并把 PDF 写到 `./aiv-reports/<报告ID>.pdf`。
|
|
51
|
+
|
|
52
|
+
## 常用命令
|
|
53
|
+
|
|
54
|
+
| 命令 | 作用 |
|
|
55
|
+
|---|---|
|
|
56
|
+
| `aiv verify --scope working` | 只验证本次未提交的改动(已提交则回退最近一次提交) |
|
|
57
|
+
| `aiv verify --scope all` | 全量验证 |
|
|
58
|
+
| `aiv report <报告ID>` | 报告摘要(结论、覆盖率、优先级分布) |
|
|
59
|
+
| `aiv tree --report <报告ID> [--view issues]` | 需求树 / 问题树 |
|
|
60
|
+
| `aiv impact --report <报告ID>` | 影响面分析 |
|
|
61
|
+
| `aiv export --report <报告ID>` | 重新导出 PDF |
|
|
62
|
+
| `aiv usage` | 当前 Token 余额与扣点记录 |
|
|
63
|
+
| `aiv kb search --project <id> --q "关键词"` | 知识库检索(混合检索 + 重排) |
|
|
64
|
+
| `aiv projects` / `aiv tasks` | 项目列表 / 最近验证任务 |
|
|
65
|
+
|
|
66
|
+
`aiv help` 看完整清单。
|
|
67
|
+
|
|
68
|
+
## 常见问题
|
|
69
|
+
|
|
70
|
+
**`未登录或登录已过期`**
|
|
71
|
+
`aiv login` 重新登录,或检查 `AIV_API_TOKEN` 是否有效(`aiv usage` 能验证)。
|
|
72
|
+
|
|
73
|
+
**接口返回 403**
|
|
74
|
+
平台侧 `AIV_ALLOWED_ORIGINS` 没包含 CLI 请求的地址;用 `--server` 指定正确的平台地址即可,或联系管理员加白名单。
|
|
75
|
+
|
|
76
|
+
**`aiv parse` 一直显示排队**
|
|
77
|
+
平台没有可用的验证执行节点(Runner)。让管理员在平台机器上安装 Chromium(`npx playwright install --with-deps chromium`),或启动独立 Runner。
|
|
78
|
+
|
|
79
|
+
**PDF 没有生成**
|
|
80
|
+
加 `--no-export` 时不会落盘;否则检查 `./aiv-reports/` 目录写权限,或用 `--out` 指定路径。
|
|
81
|
+
|
|
82
|
+
## License
|
|
83
|
+
|
|
84
|
+
MIT
|