@optima-chat/commerce-cli 1.0.0 → 1.2.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/.claude/skills/commerce-i18n/SKILL.md +141 -0
- package/.claude/skills/commerce-inventory/SKILL.md +83 -0
- package/.claude/skills/commerce-order/SKILL.md +112 -0
- package/.claude/skills/commerce-product/SKILL.md +108 -0
- package/.claude/skills/commerce-storefront/SKILL.md +110 -0
- package/README.md +41 -51
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +122 -67
- package/dist/commands/init.js.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/postinstall.js +6 -91
- package/dist/postinstall.js.map +1 -1
- package/dist/preuninstall.d.ts +0 -1
- package/dist/preuninstall.js +3 -51
- package/dist/preuninstall.js.map +1 -1
- package/package.json +1 -1
- package/.claude/CLAUDE.md +0 -101
- package/dist/commands/cleanup.d.ts +0 -3
- package/dist/commands/cleanup.d.ts.map +0 -1
- package/dist/commands/cleanup.js +0 -100
- package/dist/commands/cleanup.js.map +0 -1
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: commerce-i18n
|
|
3
|
+
description: Internationalization and translation management. Add multilingual translations for products, variants, collections, merchant info, homepage sections. Use when user needs to translate content, manage multiple languages, or configure i18n settings.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Commerce CLI - Internationalization
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
国际化模块,用于管理商品、变体、集合、商户和首页的多语言翻译。
|
|
11
|
+
|
|
12
|
+
## Instructions
|
|
13
|
+
|
|
14
|
+
### 自然语言映射
|
|
15
|
+
|
|
16
|
+
当用户说:
|
|
17
|
+
- "给商品添加中文翻译" → `commerce i18n product create --product-id XX --lang zh-CN`
|
|
18
|
+
- "翻译商品变体" → `commerce i18n variant create --variant-id XX --lang YY`
|
|
19
|
+
- "翻译集合信息" → `commerce i18n collection create --collection-id XX --lang YY`
|
|
20
|
+
- "设置商户多语言信息" → `commerce i18n merchant create --lang XX`
|
|
21
|
+
- "翻译首页区块" → `commerce i18n homepage set --section-id XX --lang YY`
|
|
22
|
+
|
|
23
|
+
### 核心功能
|
|
24
|
+
|
|
25
|
+
**商品翻译**:
|
|
26
|
+
- `commerce i18n product create` - 创建商品翻译
|
|
27
|
+
- `commerce i18n product list` - 查看商品翻译列表
|
|
28
|
+
- `commerce i18n product get` - 查看单个翻译
|
|
29
|
+
- `commerce i18n product update` - 更新翻译
|
|
30
|
+
- `commerce i18n product delete` - 删除翻译
|
|
31
|
+
|
|
32
|
+
**变体翻译**:
|
|
33
|
+
- `commerce i18n variant create` - 创建变体翻译
|
|
34
|
+
- `commerce i18n variant list` - 查看变体翻译
|
|
35
|
+
- `commerce i18n variant update` - 更新变体翻译
|
|
36
|
+
- `commerce i18n variant delete` - 删除变体翻译
|
|
37
|
+
|
|
38
|
+
**集合翻译**:
|
|
39
|
+
- `commerce i18n collection create` - 创建集合翻译
|
|
40
|
+
- `commerce i18n collection list` - 查看集合翻译
|
|
41
|
+
- `commerce i18n collection update` - 更新集合翻译
|
|
42
|
+
- `commerce i18n collection delete` - 删除集合翻译
|
|
43
|
+
|
|
44
|
+
**商户翻译**:
|
|
45
|
+
- `commerce i18n merchant create` - 创建商户翻译
|
|
46
|
+
- `commerce i18n merchant list` - 查看商户翻译
|
|
47
|
+
- `commerce i18n merchant update` - 更新商户翻译
|
|
48
|
+
- `commerce i18n merchant delete` - 删除商户翻译
|
|
49
|
+
|
|
50
|
+
**首页翻译**:
|
|
51
|
+
- `commerce i18n homepage set` - 设置首页区块翻译
|
|
52
|
+
- `commerce i18n homepage list` - 查看首页翻译
|
|
53
|
+
- `commerce i18n homepage delete` - 删除首页翻译
|
|
54
|
+
|
|
55
|
+
## Examples
|
|
56
|
+
|
|
57
|
+
### 商品翻译
|
|
58
|
+
```bash
|
|
59
|
+
# 用户说:"给商品prod_123添加中文翻译"
|
|
60
|
+
commerce i18n product create \
|
|
61
|
+
--product-id prod_123 \
|
|
62
|
+
--lang zh-CN \
|
|
63
|
+
--name "手工陶瓷杯" \
|
|
64
|
+
--description "精美的手工制作陶瓷杯,适合日常使用"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 变体翻译
|
|
68
|
+
```bash
|
|
69
|
+
# 用户说:"给变体var_456添加日语翻译,包括规格翻译"
|
|
70
|
+
commerce i18n variant create \
|
|
71
|
+
--variant-id var_456 \
|
|
72
|
+
--lang ja-JP \
|
|
73
|
+
--name "セラミックマグ(赤・小)" \
|
|
74
|
+
--variant-attributes-translations '{
|
|
75
|
+
"颜色": {
|
|
76
|
+
"key_translation": "色",
|
|
77
|
+
"value_translation": {"红色": "赤"}
|
|
78
|
+
},
|
|
79
|
+
"尺寸": {
|
|
80
|
+
"key_translation": "サイズ",
|
|
81
|
+
"value_translation": {"S": "小"}
|
|
82
|
+
}
|
|
83
|
+
}'
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### 集合翻译
|
|
87
|
+
```bash
|
|
88
|
+
# 用户说:"给summer-sale集合添加西班牙语翻译"
|
|
89
|
+
commerce i18n collection create \
|
|
90
|
+
--collection-id coll_789 \
|
|
91
|
+
--lang es-ES \
|
|
92
|
+
--name "Promoción de Verano" \
|
|
93
|
+
--description "Grandes ofertas para el verano"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 商户翻译
|
|
97
|
+
```bash
|
|
98
|
+
# 用户说:"添加商户的英文翻译"
|
|
99
|
+
commerce i18n merchant create \
|
|
100
|
+
--lang en-US \
|
|
101
|
+
--name "Fashion Store" \
|
|
102
|
+
--description "Your premium fashion destination"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### 首页区块翻译
|
|
106
|
+
```bash
|
|
107
|
+
# 用户说:"给首页精选区块添加中英文标题"
|
|
108
|
+
# 中文
|
|
109
|
+
commerce i18n homepage set \
|
|
110
|
+
--section-id section_123 \
|
|
111
|
+
--lang zh-CN \
|
|
112
|
+
--title "精选商品" \
|
|
113
|
+
--description "查看我们最受欢迎的产品"
|
|
114
|
+
|
|
115
|
+
# 英文
|
|
116
|
+
commerce i18n homepage set \
|
|
117
|
+
--section-id section_123 \
|
|
118
|
+
--lang en-US \
|
|
119
|
+
--title "Featured Products" \
|
|
120
|
+
--description "Discover our most popular items"
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### 批量翻译
|
|
124
|
+
```bash
|
|
125
|
+
# 用户说:"把所有商品翻译成日语"
|
|
126
|
+
# 1. 获取商品列表
|
|
127
|
+
commerce product list --limit 100
|
|
128
|
+
|
|
129
|
+
# 2. 逐个添加翻译
|
|
130
|
+
commerce i18n product create --product-id prod_1 --lang ja-JP --name "..."
|
|
131
|
+
commerce i18n product create --product-id prod_2 --lang ja-JP --name "..."
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Notes
|
|
135
|
+
|
|
136
|
+
- 支持的语言:en-US, es-ES, ja-JP, vi-VN, zh-CN
|
|
137
|
+
- 变体翻译的 `variant-attributes-translations` 格式复杂,需要同时翻译规格键和值
|
|
138
|
+
- 商户翻译是单例,不需要指定 ID
|
|
139
|
+
- 首页区块翻译用于前端展示的多语言标题和描述
|
|
140
|
+
- 主商品的 variant_attributes_translations 会自动从变体聚合
|
|
141
|
+
- 使用 `--help` 查看命令详细参数
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: commerce-inventory
|
|
3
|
+
description: Inventory management and stock monitoring. Track stock levels, update inventory, check low stock alerts, view inventory history, reserve stock. Use when user needs to check stock, replenish inventory, monitor low stock warnings, or manage stock reservations.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Commerce CLI - Inventory Management
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
库存管理模块,用于监控库存水平、补货、预留和历史跟踪。
|
|
11
|
+
|
|
12
|
+
## Instructions
|
|
13
|
+
|
|
14
|
+
### 自然语言映射
|
|
15
|
+
|
|
16
|
+
当用户说:
|
|
17
|
+
- "查看库存低于10的商品" → `commerce inventory low-stock --threshold 10`
|
|
18
|
+
- "商品XX补货50个" → `commerce inventory update --id XX --quantity 50 --reason "补货"`
|
|
19
|
+
- "预留库存" → `commerce inventory reserve --product-id XX --quantity YY`
|
|
20
|
+
- "查看库存历史" → `commerce inventory history --product-id XX`
|
|
21
|
+
- "查看所有商品库存" → `commerce inventory list`
|
|
22
|
+
|
|
23
|
+
### 核心功能
|
|
24
|
+
|
|
25
|
+
**库存查询**:
|
|
26
|
+
- `commerce inventory list` - 查看所有商品库存
|
|
27
|
+
- `commerce inventory get` - 查看单个商品库存
|
|
28
|
+
- `commerce inventory low-stock` - 查看低库存商品
|
|
29
|
+
- `commerce inventory history` - 查看库存变更历史
|
|
30
|
+
|
|
31
|
+
**库存更新**:
|
|
32
|
+
- `commerce inventory update` - 更新库存数量
|
|
33
|
+
- `commerce inventory reserve` - 预留库存
|
|
34
|
+
- `commerce inventory release` - 释放预留库存
|
|
35
|
+
|
|
36
|
+
## Examples
|
|
37
|
+
|
|
38
|
+
### 查看低库存预警
|
|
39
|
+
```bash
|
|
40
|
+
# 用户说:"查看库存低于5的商品"
|
|
41
|
+
commerce inventory low-stock --threshold 5
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 补货操作
|
|
45
|
+
```bash
|
|
46
|
+
# 用户说:"商品prod_123补货100个"
|
|
47
|
+
commerce inventory update \
|
|
48
|
+
--id prod_123 \
|
|
49
|
+
--quantity 100 \
|
|
50
|
+
--reason "定期补货"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 预留库存
|
|
54
|
+
```bash
|
|
55
|
+
# 用户说:"为订单预留5个商品"
|
|
56
|
+
commerce inventory reserve \
|
|
57
|
+
--product-id prod_123 \
|
|
58
|
+
--quantity 5 \
|
|
59
|
+
--order-id order_456
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 查看库存历史
|
|
63
|
+
```bash
|
|
64
|
+
# 用户说:"查看商品prod_123的库存变更记录"
|
|
65
|
+
commerce inventory history \
|
|
66
|
+
--product-id prod_123 \
|
|
67
|
+
--limit 20
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 批量查看库存
|
|
71
|
+
```bash
|
|
72
|
+
# 用户说:"查看所有商品的库存情况"
|
|
73
|
+
commerce inventory list --limit 100
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Notes
|
|
77
|
+
|
|
78
|
+
- 库存变更会自动记录历史
|
|
79
|
+
- 预留库存不会减少可用库存数量
|
|
80
|
+
- 更新库存时建议添加 `--reason` 说明原因
|
|
81
|
+
- 低库存阈值可以自定义
|
|
82
|
+
- 支持批量库存更新(通过脚本循环调用)
|
|
83
|
+
- 使用 `--help` 查看命令详细参数
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: commerce-order
|
|
3
|
+
description: Order fulfillment and shipping management. Process orders, ship packages, handle cancellations, manage refunds, track shipments. Use when user needs to fulfill orders, ship products, cancel orders, process refunds, or check shipping status.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Commerce CLI - Order Fulfillment
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
订单履行模块,用于处理订单、发货、售后和物流跟踪。
|
|
11
|
+
|
|
12
|
+
## Instructions
|
|
13
|
+
|
|
14
|
+
### 自然语言映射
|
|
15
|
+
|
|
16
|
+
当用户说:
|
|
17
|
+
- "查看待发货订单" → `commerce order list --status paid`
|
|
18
|
+
- "订单XX发货" → `commerce order ship --id XX --tracking YY --carrier ZZ`
|
|
19
|
+
- "取消订单XX" → `commerce order cancel --id XX --yes`
|
|
20
|
+
- "标记订单已送达" → `commerce order mark-delivered --id XX`
|
|
21
|
+
- "查询运费" → `commerce shipping calculate --country XX --weight YY`
|
|
22
|
+
- "处理退款" → `commerce refund create --order-id XX --amount YY`
|
|
23
|
+
|
|
24
|
+
### 核心功能
|
|
25
|
+
|
|
26
|
+
**订单管理**:
|
|
27
|
+
- `commerce order list` - 查看订单列表
|
|
28
|
+
- `commerce order get` - 查看订单详情
|
|
29
|
+
- `commerce order ship` - 标记订单发货
|
|
30
|
+
- `commerce order cancel` - 取消订单
|
|
31
|
+
- `commerce order complete` - 完成订单
|
|
32
|
+
- `commerce order mark-delivered` - 标记已送达
|
|
33
|
+
|
|
34
|
+
**退款管理**:
|
|
35
|
+
- `commerce refund create` - 创建退款
|
|
36
|
+
- `commerce refund list` - 查看退款列表
|
|
37
|
+
- `commerce refund get` - 查看退款详情
|
|
38
|
+
- `commerce refund approve` - 批准退款
|
|
39
|
+
- `commerce refund reject` - 拒绝退款
|
|
40
|
+
|
|
41
|
+
**物流管理**:
|
|
42
|
+
- `commerce shipping calculate` - 计算运费
|
|
43
|
+
- `commerce shipping track` - 物流追踪
|
|
44
|
+
- `commerce shipping update-status` - 更新物流状态
|
|
45
|
+
|
|
46
|
+
## Examples
|
|
47
|
+
|
|
48
|
+
### 查看待处理订单
|
|
49
|
+
```bash
|
|
50
|
+
# 用户说:"查看今天待发货的订单"
|
|
51
|
+
commerce order list --status paid --limit 50
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 订单发货
|
|
55
|
+
```bash
|
|
56
|
+
# 用户说:"订单order_123发货,快递单号DHL123456,承运商DHL"
|
|
57
|
+
commerce order ship \
|
|
58
|
+
--id order_123 \
|
|
59
|
+
--tracking DHL123456 \
|
|
60
|
+
--carrier DHL
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### 取消订单
|
|
64
|
+
```bash
|
|
65
|
+
# 用户说:"取消订单order_456,原因是客户要求"
|
|
66
|
+
commerce order cancel \
|
|
67
|
+
--id order_456 \
|
|
68
|
+
--reason "客户要求取消" \
|
|
69
|
+
--yes
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### 标记订单完成
|
|
73
|
+
```bash
|
|
74
|
+
# 用户说:"标记订单order_789已送达"
|
|
75
|
+
commerce order mark-delivered --id order_789
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### 计算运费
|
|
79
|
+
```bash
|
|
80
|
+
# 用户说:"计算寄到美国纽约10001的运费,重量0.5kg"
|
|
81
|
+
commerce shipping calculate \
|
|
82
|
+
--country US \
|
|
83
|
+
--postal-code 10001 \
|
|
84
|
+
--weight 0.5
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 处理退款
|
|
88
|
+
```bash
|
|
89
|
+
# 用户说:"订单order_123要退款150美元"
|
|
90
|
+
commerce refund create \
|
|
91
|
+
--order-id order_123 \
|
|
92
|
+
--amount 150 \
|
|
93
|
+
--reason "商品有瑕疵"
|
|
94
|
+
|
|
95
|
+
# 批准退款
|
|
96
|
+
commerce refund approve --id refund_456
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### 物流追踪
|
|
100
|
+
```bash
|
|
101
|
+
# 用户说:"查询快递单号DHL123456的物流信息"
|
|
102
|
+
commerce shipping track --tracking-number DHL123456
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Notes
|
|
106
|
+
|
|
107
|
+
- 订单状态流转:pending → paid → shipped → delivered → completed
|
|
108
|
+
- 取消和删除操作需要 `--yes` 确认
|
|
109
|
+
- 发货后订单状态自动变为 shipped
|
|
110
|
+
- 退款需要先创建,然后批准才会实际退款
|
|
111
|
+
- 支持的物流商:DHL, FedEx, UPS, USPS, SF Express, 顺丰
|
|
112
|
+
- 使用 `--help` 查看命令详细参数
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: commerce-product
|
|
3
|
+
description: Product catalog management for e-commerce stores. Create and update products, manage variants/SKUs, upload product images, organize tags. Use when user needs to add new products, update pricing, manage product inventory, upload photos, or organize product catalog.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Commerce CLI - Product Management
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
商品管理模块,用于电商商品目录的创建、编辑和组织。
|
|
11
|
+
|
|
12
|
+
## Instructions
|
|
13
|
+
|
|
14
|
+
### 自然语言映射
|
|
15
|
+
|
|
16
|
+
当用户说:
|
|
17
|
+
- "创建XX商品,价格YY" → `commerce product create --title XX --price YY`
|
|
18
|
+
- "上传商品图片" → `commerce upload image --path ./photo.jpg`
|
|
19
|
+
- "添加商品变体" → `commerce variant create --product-id XX --sku YY`
|
|
20
|
+
- "更新商品价格" → `commerce product update --id XX --price YY`
|
|
21
|
+
- "给商品打标签" → `commerce product update --id XX --tags "featured,new"`
|
|
22
|
+
- "查看所有商品" → `commerce product list`
|
|
23
|
+
|
|
24
|
+
### 核心功能
|
|
25
|
+
|
|
26
|
+
**商品 CRUD**:
|
|
27
|
+
- `commerce product create` - 创建商品
|
|
28
|
+
- `commerce product list` - 查看商品列表
|
|
29
|
+
- `commerce product get` - 查看商品详情
|
|
30
|
+
- `commerce product update` - 更新商品信息
|
|
31
|
+
- `commerce product delete` - 删除商品
|
|
32
|
+
|
|
33
|
+
**变体/SKU 管理**:
|
|
34
|
+
- `commerce variant create` - 创建商品变体
|
|
35
|
+
- `commerce variant list` - 查看变体列表
|
|
36
|
+
- `commerce variant update` - 更新变体信息
|
|
37
|
+
- `commerce variant delete` - 删除变体
|
|
38
|
+
|
|
39
|
+
**图片管理**:
|
|
40
|
+
- `commerce upload image` - 上传图片
|
|
41
|
+
- `commerce product add-images` - 关联图片到商品
|
|
42
|
+
- `commerce product remove-images` - 移除商品图片
|
|
43
|
+
|
|
44
|
+
## Examples
|
|
45
|
+
|
|
46
|
+
### 创建商品
|
|
47
|
+
```bash
|
|
48
|
+
# 用户说:"创建T恤商品,99美元,库存20"
|
|
49
|
+
commerce product create \
|
|
50
|
+
--title "T恤" \
|
|
51
|
+
--price 99 \
|
|
52
|
+
--stock 20 \
|
|
53
|
+
--description "100% 纯棉T恤"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 上传商品图片
|
|
57
|
+
```bash
|
|
58
|
+
# 用户说:"上传商品主图"
|
|
59
|
+
commerce upload image --path ./tshirt-main.jpg
|
|
60
|
+
# 返回: { media_id: "media_123" }
|
|
61
|
+
|
|
62
|
+
# 关联到商品
|
|
63
|
+
commerce product add-images \
|
|
64
|
+
--id prod_123 \
|
|
65
|
+
--media-id media_123
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 创建商品变体
|
|
69
|
+
```bash
|
|
70
|
+
# 用户说:"给商品添加红色S码的变体"
|
|
71
|
+
commerce variant create \
|
|
72
|
+
--product-id prod_123 \
|
|
73
|
+
--sku "TSHIRT-RED-S" \
|
|
74
|
+
--price 99 \
|
|
75
|
+
--stock 50 \
|
|
76
|
+
--attributes '{"颜色":"红色","尺寸":"S"}'
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 管理商品标签
|
|
80
|
+
```bash
|
|
81
|
+
# 用户说:"把商品标记为精选和新品"
|
|
82
|
+
commerce product update \
|
|
83
|
+
--id prod_123 \
|
|
84
|
+
--tags "featured,new"
|
|
85
|
+
|
|
86
|
+
# 查看带特定标签的商品
|
|
87
|
+
commerce product list --tags "featured"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### 批量更新价格
|
|
91
|
+
```bash
|
|
92
|
+
# 用户说:"把所有T恤价格改成89"
|
|
93
|
+
# 1. 先查找T恤商品
|
|
94
|
+
commerce product list --query "T恤"
|
|
95
|
+
|
|
96
|
+
# 2. 逐个更新
|
|
97
|
+
commerce product update --id prod_123 --price 89
|
|
98
|
+
commerce product update --id prod_456 --price 89
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Notes
|
|
102
|
+
|
|
103
|
+
- 所有命令默认 JSON 输出,便于 AI 解析
|
|
104
|
+
- 图片需要先上传获取 `media_id`,再关联到商品
|
|
105
|
+
- 变体的 `attributes` 使用 JSON 格式
|
|
106
|
+
- 标签使用逗号分隔的字符串
|
|
107
|
+
- 支持的图片格式:JPG, PNG, WebP
|
|
108
|
+
- 使用 `--help` 查看命令详细参数
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: commerce-storefront
|
|
3
|
+
description: Storefront and homepage configuration. Manage homepage sections, product collections, merchant profile, navigation menus, banners. Use when user needs to configure homepage, create product collections, update store information, or organize storefront layout.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Commerce CLI - Storefront Configuration
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
店铺前台配置模块,用于首页设置、商品集合管理和商户信息维护。
|
|
11
|
+
|
|
12
|
+
## Instructions
|
|
13
|
+
|
|
14
|
+
### 自然语言映射
|
|
15
|
+
|
|
16
|
+
当用户说:
|
|
17
|
+
- "创建首页轮播图" → `commerce homepage module create --type banner ...`
|
|
18
|
+
- "更新首页设置" → `commerce homepage settings update --show-search true`
|
|
19
|
+
- "创建商品集合" → `commerce collection create --name XX --slug YY`
|
|
20
|
+
- "把商品添加到集合" → `commerce collection add-products --id XX --product-ids YY`
|
|
21
|
+
- "更新店铺信息" → `commerce merchant update --name XX`
|
|
22
|
+
|
|
23
|
+
### 核心功能
|
|
24
|
+
|
|
25
|
+
**首页模块管理**:
|
|
26
|
+
- `commerce homepage module create` - 创建首页模块
|
|
27
|
+
- `commerce homepage module list` - 查看所有模块
|
|
28
|
+
- `commerce homepage module update` - 更新模块
|
|
29
|
+
- `commerce homepage module delete` - 删除模块
|
|
30
|
+
- `commerce homepage module reorder` - 重新排序
|
|
31
|
+
|
|
32
|
+
**首页设置**:
|
|
33
|
+
- `commerce homepage settings get` - 查看首页设置
|
|
34
|
+
- `commerce homepage settings update` - 更新首页设置
|
|
35
|
+
|
|
36
|
+
**商品集合**:
|
|
37
|
+
- `commerce collection create` - 创建集合
|
|
38
|
+
- `commerce collection list` - 查看集合列表
|
|
39
|
+
- `commerce collection update` - 更新集合
|
|
40
|
+
- `commerce collection delete` - 删除集合
|
|
41
|
+
- `commerce collection add-products` - 添加商品到集合
|
|
42
|
+
- `commerce collection remove-products` - 从集合移除商品
|
|
43
|
+
|
|
44
|
+
**商户信息**:
|
|
45
|
+
- `commerce merchant info` - 查看商户信息
|
|
46
|
+
- `commerce merchant update` - 更新商户信息
|
|
47
|
+
- `commerce merchant init` - 初始化商户设置
|
|
48
|
+
|
|
49
|
+
## Examples
|
|
50
|
+
|
|
51
|
+
### 创建首页轮播图
|
|
52
|
+
```bash
|
|
53
|
+
# 用户说:"创建首页轮播图模块"
|
|
54
|
+
commerce homepage module create \
|
|
55
|
+
--slug hero-banner \
|
|
56
|
+
--type banner \
|
|
57
|
+
--position 1 \
|
|
58
|
+
--enabled true \
|
|
59
|
+
--config '{"images":[{"url":"https://example.com/banner1.jpg"}]}'
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 更新首页设置
|
|
63
|
+
```bash
|
|
64
|
+
# 用户说:"启用首页搜索功能,显示8个精选商品"
|
|
65
|
+
commerce homepage settings update \
|
|
66
|
+
--show-search true \
|
|
67
|
+
--featured-limit 8
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 创建商品集合
|
|
71
|
+
```bash
|
|
72
|
+
# 用户说:"创建夏季促销集合"
|
|
73
|
+
commerce collection create \
|
|
74
|
+
--name "Summer Sale" \
|
|
75
|
+
--slug summer-sale \
|
|
76
|
+
--description "Hot deals for summer"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 添加商品到集合
|
|
80
|
+
```bash
|
|
81
|
+
# 用户说:"把商品prod_123和prod_456添加到summer-sale集合"
|
|
82
|
+
commerce collection add-products \
|
|
83
|
+
--slug summer-sale \
|
|
84
|
+
--product-ids prod_123,prod_456
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 更新商户信息
|
|
88
|
+
```bash
|
|
89
|
+
# 用户说:"更新店铺名称和描述"
|
|
90
|
+
commerce merchant update \
|
|
91
|
+
--name "My Fashion Store" \
|
|
92
|
+
--description "Premium fashion for everyone"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### 重新排序首页模块
|
|
96
|
+
```bash
|
|
97
|
+
# 用户说:"调整首页模块顺序"
|
|
98
|
+
commerce homepage module reorder \
|
|
99
|
+
--module-id module_123 \
|
|
100
|
+
--position 2
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Notes
|
|
104
|
+
|
|
105
|
+
- 首页模块支持类型:banner(轮播图)、featured(精选商品)、categories(分类)
|
|
106
|
+
- 集合 slug 必须唯一,用于 URL
|
|
107
|
+
- 模块的 position 决定显示顺序(从小到大)
|
|
108
|
+
- config 字段使用 JSON 格式
|
|
109
|
+
- 集合可以手动管理商品,也可以设置自动规则
|
|
110
|
+
- 使用 `--help` 查看命令详细参数
|