@windaka-erp/erp-cli 0.4.0 → 0.4.1
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.md
CHANGED
|
@@ -1,93 +1,119 @@
|
|
|
1
1
|
# @windaka-erp/erp-cli
|
|
2
2
|
|
|
3
|
-
物达通(WindaKa)物业管理 ERP
|
|
3
|
+
> 物达通(WindaKa)物业管理 ERP 的命令行工具,为人类和 AI Agent 设计。
|
|
4
|
+
> 一句话:**用户说自然语言,AI Agent 通过本工具操作 ERP + 检索知识库**。
|
|
4
5
|
|
|
5
|
-
##
|
|
6
|
+
## 它能做什么
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
- **知识库问答**:对接 RAGFlow,问"消防巡检怎么处理""报修流程""物业费标准"等问题,先检索知识库拿到原文,再结合上下文回答。
|
|
9
|
+
- **ERP 操作**:查/建工单、分派、接单、确认、回访等工单全流程;查看项目、通讯录、费用(逐步完善中)。
|
|
10
|
+
- **AI Agent 友好**:统一 JSON 输出、`--dry-run` 预览、危险操作确认、意图路由文档,AI 装上 Skill 即用。
|
|
8
11
|
|
|
9
|
-
|
|
12
|
+
## 安装
|
|
10
13
|
|
|
11
14
|
```bash
|
|
12
|
-
# 安装 CLI
|
|
13
15
|
npm install -g @windaka-erp/erp-cli
|
|
14
|
-
|
|
15
|
-
# 安装 Skills(必需,让 AI Agent 知道如何使用 CLI)
|
|
16
|
-
npx skills add windaka-erp/erp-cli -y -g
|
|
17
16
|
```
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
> 二进制已打包进 npm 包(含 Windows/macOS/Linux 的 x64/arm64 六个平台),安装即用,无需联网下载。
|
|
19
|
+
|
|
20
|
+
国内用户用淘宝镜像加速:
|
|
20
21
|
|
|
21
22
|
```bash
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
go build -o erp-cli .
|
|
23
|
+
npm install -g @windaka-erp/erp-cli --registry=https://registry.npmmirror.com
|
|
24
|
+
```
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
验证:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
erp-cli --version
|
|
28
30
|
```
|
|
29
31
|
|
|
30
32
|
## 快速开始
|
|
31
33
|
|
|
32
|
-
###
|
|
34
|
+
### 1. 配置 ERP 地址
|
|
33
35
|
|
|
34
36
|
```bash
|
|
35
|
-
# 1. 初始化配置
|
|
36
37
|
erp-cli config init
|
|
38
|
+
# 默认连生产环境,也可指定:
|
|
39
|
+
erp-cli config init --base-url https://your-erp-server.com/prod-api
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 2. 登录(Device Flow,扫码/账号授权)
|
|
37
43
|
|
|
38
|
-
|
|
44
|
+
```bash
|
|
39
45
|
erp-cli auth login
|
|
46
|
+
# 输出登录链接 → 浏览器打开授权 → 自动保存 token
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 3. 开始用
|
|
40
50
|
|
|
41
|
-
|
|
42
|
-
erp-cli workorder +list
|
|
51
|
+
```bash
|
|
52
|
+
erp-cli workorder +list # 我的待办工单
|
|
53
|
+
erp-cli workorder +info --id 123 --dept-id 456 # 工单详情
|
|
54
|
+
erp-cli knowledge +search --question "报修流程" # 检索知识库
|
|
43
55
|
```
|
|
44
56
|
|
|
45
|
-
|
|
57
|
+
## 配置知识库(RAGFlow)
|
|
46
58
|
|
|
47
|
-
|
|
59
|
+
知识库检索走独立的 RAGFlow 服务,首次用要配地址、API Key、知识库 ID:
|
|
48
60
|
|
|
49
61
|
```bash
|
|
50
|
-
|
|
51
|
-
|
|
62
|
+
erp-cli config ragflow
|
|
63
|
+
# 交互式引导:输入 RAGFlow 地址、API Key,自动列出知识库让你选
|
|
64
|
+
```
|
|
52
65
|
|
|
53
|
-
|
|
54
|
-
npx skills add windaka-erp/erp-cli -y -g
|
|
66
|
+
验证:
|
|
55
67
|
|
|
56
|
-
|
|
57
|
-
erp-cli
|
|
68
|
+
```bash
|
|
69
|
+
erp-cli knowledge +check # 检查 RAGFlow 连通性
|
|
70
|
+
erp-cli knowledge +list-datasets # 列出知识库
|
|
58
71
|
```
|
|
59
72
|
|
|
60
|
-
|
|
73
|
+
> 知识库检索不需要 ERP 登录,走 RAGFlow 自己的 API Key。
|
|
61
74
|
|
|
62
|
-
##
|
|
75
|
+
## 命令一览
|
|
63
76
|
|
|
64
77
|
```
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
78
|
+
config init/show/set/remove # 配置管理(ERP 地址、RAGFlow)
|
|
79
|
+
config ragflow # 交互式配置 RAGFlow 知识库
|
|
80
|
+
auth login/login-start/login-wait # 登录(两步登录适合 AI Agent)
|
|
81
|
+
auth status/logout # 登录状态
|
|
82
|
+
knowledge +search # 检索知识库(核心高频)
|
|
83
|
+
knowledge +list-datasets # 列出知识库
|
|
84
|
+
knowledge +check # 检查 RAGFlow 连通性
|
|
85
|
+
workorder +list # 我的待办工单
|
|
86
|
+
workorder +handle-list # 我经办的工单(含历史)
|
|
87
|
+
workorder +info # 工单详情(含处理记录)
|
|
88
|
+
workorder +search-user # 搜索员工(分派/转单用)
|
|
89
|
+
workorder +apportion # 分派工单
|
|
90
|
+
api GET/POST <path> # 原始 API 调用(兜底)
|
|
71
91
|
```
|
|
72
92
|
|
|
73
|
-
|
|
93
|
+
所有命令加 `--help` 看详细参数,加 `--dry-run` 预览请求不实际执行。
|
|
94
|
+
|
|
95
|
+
## 全局参数
|
|
74
96
|
|
|
75
97
|
- `--profile <name>` — 切换环境(prod/staging),默认 default
|
|
76
98
|
- `--dry-run` — 预览请求内容,不实际执行
|
|
99
|
+
- `--format json|table|csv` — 输出格式,默认 json
|
|
100
|
+
|
|
101
|
+
> 单用户模式:一个环境(profile)一个登录 token,命令不带任何身份参数。
|
|
77
102
|
|
|
78
|
-
## Agent
|
|
103
|
+
## AI Agent 使用
|
|
79
104
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
105
|
+
本工具为 AI Agent 设计。配合 **Skills**(AI 使用文档,含意图路由、命令参数、行为规则)使用,AI 即可:
|
|
106
|
+
- 听懂用户口语("我的待办""消防巡检怎么处理")→ 自动选对命令
|
|
107
|
+
- 写操作前确认、危险操作 dry-run
|
|
108
|
+
- 知识库优先:非 ERP 操作的问题默认先检索知识库
|
|
83
109
|
|
|
84
|
-
|
|
110
|
+
Skills 由作者单独发布,安装方式见对应平台说明。
|
|
85
111
|
|
|
86
|
-
##
|
|
112
|
+
## 环境要求
|
|
87
113
|
|
|
88
114
|
- Node.js >= 14.0.0
|
|
89
|
-
-
|
|
115
|
+
- 平台:Windows / macOS / Linux(均支持 x64 和 arm64)
|
|
90
116
|
|
|
91
117
|
## License
|
|
92
118
|
|
|
93
|
-
MIT
|
|
119
|
+
MIT
|
package/bin/erp-cli-darwin-amd64
CHANGED
|
Binary file
|
package/bin/erp-cli-darwin-arm64
CHANGED
|
Binary file
|
package/bin/erp-cli-linux-amd64
CHANGED
|
Binary file
|
package/bin/erp-cli-linux-arm64
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED