@optima-chat/optima-agent 0.4.11 → 0.4.12

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.
@@ -38,7 +38,9 @@
38
38
  "Bash(npm publish:*)",
39
39
  "Bash(pkill:*)",
40
40
  "Bash(git -C /Users/verypro/optima-agent log --oneline --all -- \".claude/\")",
41
- "Bash(wc:*)"
41
+ "Bash(wc:*)",
42
+ "Bash(grep:*)",
43
+ "Bash(find:*)"
42
44
  ],
43
45
  "deny": [],
44
46
  "ask": []
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: bi
3
- description: "业务数据分析工具。使用场景:查看销售数据(sales/销售)、产品表现分析(product/产品)、趋势分析(trends/趋势)、综合分析(analytics/分析)。使用 bi-cli 命令。"
3
+ description: "业务数据分析工具。使用场景:查看销售数据(sales/销售)、产品表现分析(product/产品)、趋势分析(trends/趋势)、高级分析(analytics/分析)、流量分析(traffic/流量)。使用 bi-cli 命令。"
4
4
  ---
5
5
 
6
6
  # BI 数据分析工具
@@ -9,54 +9,81 @@ description: "业务数据分析工具。使用场景:查看销售数据(sales
9
9
 
10
10
  **命令名称是 `bi-cli`,不是 `bi`**
11
11
 
12
- ## 标准操作
12
+ ## 命令参考
13
+
14
+ ### 销售分析 (sales)
13
15
 
14
- ### 查看销售数据
15
16
  ```bash
16
17
  bi-cli sales get [--days 7] [--pretty]
17
18
  ```
18
- 返回销售汇总和每日明细:
19
- - 总收入、订单数、客单价、客户数
20
- - 每日销售分解
21
19
 
22
- ### 产品表现分析
23
- ```bash
24
- bi-cli product best-sellers [--limit 10] [--pretty]
25
- ```
26
- 返回畅销商品排行
20
+ 返回:总收入、订单数、客单价、客户数、每日明细
27
21
 
28
- ### 趋势分析
29
- ```bash
30
- bi-cli trends revenue --days 30 [--pretty]
31
- ```
32
- 返回收入趋势数据
22
+ ### 产品分析 (product)
33
23
 
34
- ### 综合分析
35
24
  ```bash
36
- bi-cli analytics dashboard [--pretty]
37
- ```
38
- 返回仪表盘数据
25
+ # 畅销商品
26
+ bi-cli product best-sellers [--limit 10] [--sort revenue|quantity] [--pretty]
39
27
 
40
- ## 完整命令列表
28
+ # ABC 库存分析(帕累托)
29
+ bi-cli product abc-analysis [--pretty]
41
30
 
42
- ### 销售分析
43
- ```bash
44
- bi-cli sales get [--days 7] [--pretty]
31
+ # 价格区间分析
32
+ bi-cli product price-analysis [--pretty]
33
+
34
+ # 商品表现
35
+ bi-cli product performance [--days 30] [--limit 20] [--pretty]
45
36
  ```
46
37
 
47
- ### 产品分析
38
+ ### 趋势分析 (trends)
39
+
48
40
  ```bash
49
- bi-cli product best-sellers [--limit 10] [--pretty]
41
+ # 收入趋势(含移动平均)
42
+ bi-cli trends revenue [--days 30] [--granularity daily|hourly|weekly] [--pretty]
43
+
44
+ # 订单热力图(按日/小时)
45
+ bi-cli trends heatmap [--pretty]
46
+
47
+ # 季节性模式
48
+ bi-cli trends seasonality [--pretty]
49
+
50
+ # 收入预测
51
+ bi-cli trends forecast [--days 7] [--pretty]
50
52
  ```
51
53
 
52
- ### 趋势分析
54
+ ### 高级分析 (analytics)
55
+
53
56
  ```bash
54
- bi-cli trends revenue --days 30 [--pretty]
57
+ # 周期对比
58
+ bi-cli analytics compare [--days 30] [--compare-to previous_period|previous_year] [--pretty]
59
+
60
+ # 增长趋势
61
+ bi-cli analytics growth [--period daily|weekly|monthly] [--pretty]
62
+
63
+ # 客户群分析(LTV)
64
+ bi-cli analytics cohort [--pretty]
65
+
66
+ # 订单状态漏斗
67
+ bi-cli analytics funnel [--days 30] [--pretty]
55
68
  ```
56
69
 
57
- ### 综合分析
70
+ ### 流量分析 (traffic)
71
+
58
72
  ```bash
59
- bi-cli analytics dashboard [--pretty]
73
+ # 流量概览
74
+ bi-cli traffic overview [--days 30] [--product <uuid>] [--pretty]
75
+
76
+ # 流量来源
77
+ bi-cli traffic sources [--limit 10] [--pretty]
78
+
79
+ # 转化漏斗
80
+ bi-cli traffic funnel [--pretty]
81
+
82
+ # 站内搜索分析
83
+ bi-cli traffic search [--zero-results] [--pretty]
84
+
85
+ # 热门页面
86
+ bi-cli traffic pages [--limit 20] [--pretty]
60
87
  ```
61
88
 
62
89
  ## 工作流示例
@@ -68,10 +95,6 @@ bi-cli analytics dashboard [--pretty]
68
95
  bi-cli sales get --days 7 --pretty
69
96
  ```
70
97
 
71
- 展示:
72
- - 总收入、订单数、客单价、客户数
73
- - 每日销售明细表格
74
-
75
98
  ### 示例 2:查看畅销商品
76
99
  用户:"哪些商品卖得最好"
77
100
 
@@ -79,10 +102,6 @@ bi-cli sales get --days 7 --pretty
79
102
  bi-cli product best-sellers --limit 5 --pretty
80
103
  ```
81
104
 
82
- 展示:
83
- - TOP5 商品排行
84
- - 销售额、销量、订单数
85
-
86
105
  ### 示例 3:收入趋势
87
106
  用户:"收入趋势如何"
88
107
 
@@ -90,13 +109,23 @@ bi-cli product best-sellers --limit 5 --pretty
90
109
  bi-cli trends revenue --days 30 --pretty
91
110
  ```
92
111
 
93
- 展示:
94
- - 30 天收入趋势
95
- - 增长率、环比数据
112
+ ### 示例 4:同比分析
113
+ 用户:"和去年同期比怎么样"
114
+
115
+ ```bash
116
+ bi-cli analytics compare --days 30 --compare-to previous_year --pretty
117
+ ```
118
+
119
+ ### 示例 5:流量来源
120
+ 用户:"流量都从哪来的"
121
+
122
+ ```bash
123
+ bi-cli traffic sources --limit 10 --pretty
124
+ ```
96
125
 
97
126
  ## 注意事项
98
127
 
99
128
  - 命令是 `bi-cli` 不是 `bi`
100
129
  - 默认输出 JSON 格式(AI 友好)
101
130
  - 使用 `--pretty` 获取彩色表格
102
- - 默认时间范围是最近 7
131
+ - 默认时间范围是最近 7 天或 30 天(因命令而异)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optima-chat/optima-agent",
3
- "version": "0.4.11",
3
+ "version": "0.4.12",
4
4
  "description": "基于 Claude Agent SDK 的电商运营 AI 助手",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",