@optima-chat/optima-agent 0.7.1 → 0.7.3
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.
|
@@ -99,7 +99,9 @@
|
|
|
99
99
|
"Bash(git checkout:*)",
|
|
100
100
|
"Bash(npm test:*)",
|
|
101
101
|
"Bash(git tag:*)",
|
|
102
|
-
"Bash(/private/tmp/claude/-Users-verypro-optima-agent/68a9ac2c-def2-44e1-b42b-e53bd9022ab6/scratchpad/test-canUseTool.sh)"
|
|
102
|
+
"Bash(/private/tmp/claude/-Users-verypro-optima-agent/68a9ac2c-def2-44e1-b42b-e53bd9022ab6/scratchpad/test-canUseTool.sh)",
|
|
103
|
+
"Bash(optima --help:*)",
|
|
104
|
+
"Bash(npx @optima-chat/ads-cli:*)"
|
|
103
105
|
],
|
|
104
106
|
"deny": [],
|
|
105
107
|
"ask": []
|
|
@@ -1,94 +1,243 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ads
|
|
3
|
-
description: Google Ads
|
|
3
|
+
description: Google Ads 广告投放管理。创建广告系列、广告组、关键词、广告,查看广告效果数据。当用户需要投放广告、管理 Google Ads、分析广告效果时使用此技能。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Google Ads CLI
|
|
6
|
+
# Google Ads CLI - 广告投放管理
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
CLI 命令: `google-ads`(或 `ads`)
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## 首次使用
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
#
|
|
14
|
-
google-ads account create --email your@gmail.com --name "公司名称"
|
|
15
|
-
|
|
16
|
-
# 验证账号
|
|
13
|
+
# 检查用户是否已授权 Google Ads 账号
|
|
17
14
|
google-ads account check
|
|
18
|
-
|
|
19
|
-
# 查看配置
|
|
20
|
-
google-ads config show
|
|
21
15
|
```
|
|
22
16
|
|
|
23
|
-
|
|
17
|
+
**返回状态**:
|
|
18
|
+
- `status: "active"` → 已授权,可以开始使用
|
|
19
|
+
- `status: "not_linked"` → 用户尚未授权 Google Ads,需引导用户在 Optima 平台完成 Google Ads 账号授权
|
|
20
|
+
|
|
21
|
+
## 典型场景
|
|
22
|
+
|
|
23
|
+
### 场景1:从零开始投放广告
|
|
24
|
+
|
|
25
|
+
**用户说**:"我想投放 Google 广告推广我的产品"
|
|
26
|
+
|
|
27
|
+
**流程**: 创建广告系列 → 创建广告组 → 添加关键词 → 创建广告 → 启用
|
|
24
28
|
|
|
25
29
|
```bash
|
|
26
|
-
#
|
|
27
|
-
google-ads campaign
|
|
30
|
+
# 1. 创建广告系列(每日预算 $50,默认 PAUSED)
|
|
31
|
+
google-ads campaign create -n "产品推广" -b 50
|
|
32
|
+
|
|
33
|
+
# 2. 创建广告组(CPC 出价 $2)
|
|
34
|
+
google-ads ad-group create --campaign-id <campaign-id> -n "核心关键词组" --cpc-bid 2
|
|
28
35
|
|
|
29
|
-
#
|
|
30
|
-
google-ads
|
|
36
|
+
# 3. 添加关键词
|
|
37
|
+
google-ads keyword add --ad-group-id <ad-group-id> -k "产品名称,品牌词,行业词"
|
|
31
38
|
|
|
32
|
-
#
|
|
33
|
-
google-ads
|
|
39
|
+
# 4. 创建广告
|
|
40
|
+
google-ads ad create \
|
|
41
|
+
--ad-group-id <ad-group-id> \
|
|
42
|
+
--headlines "优质产品,限时优惠,免费配送" \
|
|
43
|
+
--descriptions "高品质产品限时优惠中,立即下单享受专属折扣" \
|
|
44
|
+
--final-url "https://shop.example.com"
|
|
34
45
|
|
|
35
|
-
#
|
|
36
|
-
google-ads campaign
|
|
37
|
-
google-ads campaign enable <campaign-id>
|
|
46
|
+
# 5. 确认无误后启用
|
|
47
|
+
google-ads campaign update --campaign-id <campaign-id> --status ENABLED
|
|
38
48
|
```
|
|
39
49
|
|
|
40
|
-
###
|
|
50
|
+
### 场景2:查看广告效果
|
|
51
|
+
|
|
52
|
+
**用户说**:"看看我的广告效果怎么样"
|
|
41
53
|
|
|
42
54
|
```bash
|
|
43
|
-
#
|
|
44
|
-
google-ads
|
|
55
|
+
# 快速查看所有广告系列状态
|
|
56
|
+
google-ads campaign list
|
|
45
57
|
|
|
46
|
-
#
|
|
47
|
-
google-ads
|
|
58
|
+
# 查看详细效果数据(GAQL 查询)
|
|
59
|
+
google-ads query -q "
|
|
60
|
+
SELECT
|
|
61
|
+
campaign.name,
|
|
62
|
+
metrics.impressions,
|
|
63
|
+
metrics.clicks,
|
|
64
|
+
metrics.ctr,
|
|
65
|
+
metrics.average_cpc,
|
|
66
|
+
metrics.cost_micros,
|
|
67
|
+
metrics.conversions
|
|
68
|
+
FROM campaign
|
|
69
|
+
WHERE segments.date DURING LAST_7_DAYS
|
|
70
|
+
ORDER BY metrics.cost_micros DESC
|
|
71
|
+
"
|
|
48
72
|
```
|
|
49
73
|
|
|
50
|
-
###
|
|
74
|
+
### 场景3:暂停/启用广告
|
|
75
|
+
|
|
76
|
+
**用户说**:"暂停那个效果不好的广告系列"
|
|
51
77
|
|
|
52
78
|
```bash
|
|
53
|
-
#
|
|
54
|
-
google-ads
|
|
79
|
+
# 先查看列表确认 ID
|
|
80
|
+
google-ads campaign list
|
|
81
|
+
|
|
82
|
+
# 暂停广告系列
|
|
83
|
+
google-ads campaign update --campaign-id <id> --status PAUSED
|
|
55
84
|
|
|
56
|
-
#
|
|
57
|
-
google-ads
|
|
85
|
+
# 重新启用
|
|
86
|
+
google-ads campaign update --campaign-id <id> --status ENABLED
|
|
58
87
|
```
|
|
59
88
|
|
|
60
|
-
###
|
|
89
|
+
### 场景4:调整预算和出价
|
|
90
|
+
|
|
91
|
+
**用户说**:"把预算提高到 100 美元"
|
|
61
92
|
|
|
62
93
|
```bash
|
|
63
|
-
#
|
|
64
|
-
google-ads
|
|
94
|
+
# 更新广告系列预算
|
|
95
|
+
google-ads campaign update --campaign-id <id> --budget 100
|
|
65
96
|
|
|
66
|
-
#
|
|
67
|
-
google-ads
|
|
97
|
+
# 更新广告组 CPC 出价
|
|
98
|
+
google-ads ad-group update --ad-group-id <id> --cpc-bid 3
|
|
68
99
|
```
|
|
69
100
|
|
|
70
|
-
|
|
101
|
+
### 场景5:添加新关键词
|
|
71
102
|
|
|
72
|
-
|
|
103
|
+
**用户说**:"给广告添加一些新关键词"
|
|
73
104
|
|
|
74
105
|
```bash
|
|
75
|
-
#
|
|
76
|
-
google-ads
|
|
77
|
-
# 获得 campaign_id
|
|
106
|
+
# 先确认广告组 ID
|
|
107
|
+
google-ads ad-group list
|
|
78
108
|
|
|
79
|
-
#
|
|
80
|
-
google-ads
|
|
81
|
-
# 获得 adgroup_id
|
|
109
|
+
# 添加关键词(默认广泛匹配)
|
|
110
|
+
google-ads keyword add --ad-group-id <id> -k "新关键词1,新关键词2"
|
|
82
111
|
|
|
83
|
-
#
|
|
84
|
-
google-ads keyword add --
|
|
112
|
+
# 添加精确匹配关键词
|
|
113
|
+
google-ads keyword add --ad-group-id <id> -k "精确词" --match-type EXACT
|
|
85
114
|
|
|
86
|
-
#
|
|
87
|
-
google-ads
|
|
115
|
+
# 添加词组匹配关键词
|
|
116
|
+
google-ads keyword add --ad-group-id <id> -k "词组匹配" --match-type PHRASE
|
|
88
117
|
```
|
|
89
118
|
|
|
90
|
-
##
|
|
119
|
+
## 场景决策表
|
|
91
120
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
121
|
+
| 用户需求 | 推荐命令 | 关键注意点 |
|
|
122
|
+
|---------|---------|-----------|
|
|
123
|
+
| 新建广告投放 | 完整流程(场景1) | 按顺序:系列→组→关键词→广告 |
|
|
124
|
+
| 查看效果 | `campaign list` 或 GAQL | GAQL 获取详细指标 |
|
|
125
|
+
| 暂停/启用 | `campaign update --status` | PAUSED 或 ENABLED |
|
|
126
|
+
| 调整预算 | `campaign update --budget` | 单位美元 |
|
|
127
|
+
| 调整出价 | `ad-group update --cpc-bid` | 单位美元 |
|
|
128
|
+
| 添加关键词 | `keyword add` | 注意匹配类型 |
|
|
129
|
+
| 删除广告 | `campaign delete` / `ad delete` | 不可恢复,建议先暂停 |
|
|
130
|
+
|
|
131
|
+
## 自然语言映射
|
|
132
|
+
|
|
133
|
+
当用户说:
|
|
134
|
+
- "投放广告" / "创建广告" → 引导完整流程(场景1)
|
|
135
|
+
- "广告效果" / "看看数据" → `campaign list` + GAQL
|
|
136
|
+
- "暂停广告" → `campaign update --status PAUSED`
|
|
137
|
+
- "启用广告" → `campaign update --status ENABLED`
|
|
138
|
+
- "调整预算到 XX" → `campaign update --budget XX`
|
|
139
|
+
- "添加关键词 XX" → `keyword add -k "XX"`
|
|
140
|
+
- "删除广告" → 先确认,再执行删除
|
|
141
|
+
|
|
142
|
+
## 关键概念
|
|
143
|
+
|
|
144
|
+
### 广告层级结构
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
Account(账号)
|
|
148
|
+
└── Campaign(广告系列)- 设置预算
|
|
149
|
+
└── Ad Group(广告组)- 设置出价
|
|
150
|
+
├── Keywords(关键词)- 触发条件
|
|
151
|
+
└── Ads(广告)- 展示内容
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### 状态说明
|
|
155
|
+
|
|
156
|
+
| 状态 | 含义 |
|
|
157
|
+
|------|------|
|
|
158
|
+
| `ENABLED` | 正常投放中 |
|
|
159
|
+
| `PAUSED` | 已暂停 |
|
|
160
|
+
| `REMOVED` | 已删除 |
|
|
161
|
+
|
|
162
|
+
### 关键词匹配类型
|
|
163
|
+
|
|
164
|
+
| 类型 | 说明 |
|
|
165
|
+
|------|------|
|
|
166
|
+
| `BROAD` | 广泛匹配(默认) |
|
|
167
|
+
| `PHRASE` | 词组匹配 |
|
|
168
|
+
| `EXACT` | 精确匹配 |
|
|
169
|
+
|
|
170
|
+
### RSA 广告要求
|
|
171
|
+
|
|
172
|
+
- **标题**: 至少 3 个,最多 15 个(每个 ≤30 字符)
|
|
173
|
+
- **描述**: 至少 2 个,最多 4 个(每个 ≤90 字符)
|
|
174
|
+
|
|
175
|
+
## 常见问题
|
|
176
|
+
|
|
177
|
+
### 广告创建后没有展示
|
|
178
|
+
|
|
179
|
+
1. 检查状态是否 PAUSED → 启用它
|
|
180
|
+
2. 账号是否设置账单信息 → 去 Google Ads 后台设置
|
|
181
|
+
3. 关键词是否有搜索量 → 添加更多关键词
|
|
182
|
+
|
|
183
|
+
### 不知道广告效果好不好
|
|
184
|
+
|
|
185
|
+
用 GAQL 查询关键指标:
|
|
186
|
+
```bash
|
|
187
|
+
google-ads query -q "
|
|
188
|
+
SELECT campaign.name, metrics.impressions, metrics.clicks, metrics.ctr, metrics.conversions, metrics.cost_micros
|
|
189
|
+
FROM campaign WHERE segments.date DURING LAST_7_DAYS
|
|
190
|
+
"
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
**指标参考**:
|
|
194
|
+
- CTR > 2% = 良好
|
|
195
|
+
- CPC 看行业,一般 $0.5-2
|
|
196
|
+
|
|
197
|
+
### 关键词出价设多少
|
|
198
|
+
|
|
199
|
+
- 新广告先设 $1-2,观察效果
|
|
200
|
+
- 效果好提高出价,效果差降低或暂停
|
|
201
|
+
|
|
202
|
+
## 命令参考
|
|
203
|
+
|
|
204
|
+
### 账号
|
|
205
|
+
- `google-ads account check` - 检查 Google Ads 账号授权状态
|
|
206
|
+
|
|
207
|
+
### 广告系列
|
|
208
|
+
- `google-ads campaign list [--status ENABLED|PAUSED]` - 列出
|
|
209
|
+
- `google-ads campaign info <id>` - 详情
|
|
210
|
+
- `google-ads campaign create -n "名称" -b 预算` - 创建
|
|
211
|
+
- `google-ads campaign update --campaign-id <id> [--status|--budget|--name]` - 更新
|
|
212
|
+
- `google-ads campaign delete --campaign-id <id>` - 删除
|
|
213
|
+
|
|
214
|
+
### 广告组
|
|
215
|
+
- `google-ads ad-group list [--campaign-id <id>]` - 列出
|
|
216
|
+
- `google-ads ad-group info <id>` - 详情
|
|
217
|
+
- `google-ads ad-group create --campaign-id <id> -n "名称" [--cpc-bid 出价]` - 创建
|
|
218
|
+
- `google-ads ad-group update --ad-group-id <id> [--status|--cpc-bid|--name]` - 更新
|
|
219
|
+
- `google-ads ad-group delete --ad-group-id <id>` - 删除
|
|
220
|
+
|
|
221
|
+
### 关键词
|
|
222
|
+
- `google-ads keyword list [--campaign-id <id>]` - 列出
|
|
223
|
+
- `google-ads keyword add --ad-group-id <id> -k "词1,词2" [--match-type BROAD|PHRASE|EXACT]` - 添加
|
|
224
|
+
- `google-ads keyword update --keyword-id <id> --status` - 更新
|
|
225
|
+
- `google-ads keyword delete --keyword-id <id>` - 删除
|
|
226
|
+
|
|
227
|
+
### 广告
|
|
228
|
+
- `google-ads ad list [--ad-group-id <id>]` - 列出
|
|
229
|
+
- `google-ads ad info <id>` - 详情
|
|
230
|
+
- `google-ads ad create --ad-group-id <id> --headlines "..." --descriptions "..." --final-url "..."` - 创建
|
|
231
|
+
- `google-ads ad update --ad-id <id> --status` - 更新
|
|
232
|
+
- `google-ads ad delete --ad-id <id>` - 删除
|
|
233
|
+
|
|
234
|
+
### GAQL 查询
|
|
235
|
+
- `google-ads query -q "SELECT ... FROM ..."` - 执行查询
|
|
236
|
+
- `google-ads query -f query.gaql` - 从文件读取
|
|
237
|
+
|
|
238
|
+
## 重要提示
|
|
239
|
+
|
|
240
|
+
- **所有命令默认 JSON 输出**
|
|
241
|
+
- **预算和出价单位**:美元
|
|
242
|
+
- **新广告默认 PAUSED**:创建后需手动启用
|
|
243
|
+
- **删除不可恢复**:建议先暂停
|
|
@@ -45,6 +45,7 @@ description: Order fulfillment and shipping management. Process orders, ship pac
|
|
|
45
45
|
|--------------------|------|----------|
|
|
46
46
|
| `easyship` | 买家选择了 Easyship 快递 | 可选 Easyship 自动发货 或 手动发货 |
|
|
47
47
|
| `fixed` | 买家使用固定运费 | 只能手动发货 |
|
|
48
|
+
| `free` | 全球免运费 | 只能手动发货 |
|
|
48
49
|
| 空/null | 历史订单 | 只能手动发货 |
|
|
49
50
|
|
|
50
51
|
#### 发货决策规则(必须严格遵守)
|
|
@@ -63,7 +64,7 @@ description: Order fulfillment and shipping management. Process orders, ship pac
|
|
|
63
64
|
3. **禁止**直接询问运单号
|
|
64
65
|
4. 等待用户选择后再执行对应命令
|
|
65
66
|
|
|
66
|
-
- **如果 `shipping_mode_used = "fixed"` 或字段为空**:
|
|
67
|
+
- **如果 `shipping_mode_used = "fixed"` 或 `"free"` 或字段为空**:
|
|
67
68
|
1. 直接询问用户提供运单号和快递公司名称
|
|
68
69
|
2. 收集信息后执行手动发货命令
|
|
69
70
|
|
|
@@ -112,7 +113,7 @@ commerce easyship couriers
|
|
|
112
113
|
#### 手动发货
|
|
113
114
|
|
|
114
115
|
**适用场景**:
|
|
115
|
-
- `shipping_mode_used = "fixed"` 或为空
|
|
116
|
+
- `shipping_mode_used = "fixed"` 或 `"free"` 或为空
|
|
116
117
|
- 或用户选择不使用 Easyship
|
|
117
118
|
|
|
118
119
|
**命令**:
|
|
@@ -320,7 +321,7 @@ commerce order get --id order_123
|
|
|
320
321
|
# 用户选择 Easyship 自动发货
|
|
321
322
|
commerce order ship --id order_123 --easyship
|
|
322
323
|
|
|
323
|
-
# 步骤2b:如果用户选择手动发货,或 shipping_mode_used = "fixed"
|
|
324
|
+
# 步骤2b:如果用户选择手动发货,或 shipping_mode_used = "fixed"/"free"
|
|
324
325
|
commerce order ship \
|
|
325
326
|
--id order_123 \
|
|
326
327
|
--tracking DHL123456 \
|
|
@@ -15,6 +15,7 @@ description: "运费配置和物流管理。使用场景:查看/设置运费
|
|
|
15
15
|
| "查看运费区域" / "固定运费" | `commerce shipping-zone list` |
|
|
16
16
|
| "添加运费区域" | `commerce shipping-zone create` |
|
|
17
17
|
| "设置默认运费" / "兜底运费" / "其他地区运费" | `commerce shipping-zone create --is-default` |
|
|
18
|
+
| "全球免运费" / "免邮" / "包邮" | `commerce shipping update-mode --mode free` |
|
|
18
19
|
| "Easyship快递" / "可用快递" | `commerce easyship couriers` |
|
|
19
20
|
| "查看发货地址" | `commerce easyship get-origin` |
|
|
20
21
|
| "更新发货地址" | `commerce merchant update --origin-*`(见 merchant skill) |
|
|
@@ -40,14 +41,21 @@ commerce shipping get-mode
|
|
|
40
41
|
### 修改模式
|
|
41
42
|
```bash
|
|
42
43
|
commerce shipping update-mode --mode <模式>
|
|
44
|
+
|
|
45
|
+
# 设置免运费模式(可配置配送天数)
|
|
46
|
+
commerce shipping update-mode --mode free --free-days-min 5 --free-days-max 10
|
|
43
47
|
```
|
|
44
48
|
|
|
45
49
|
| 模式 | 说明 |
|
|
46
50
|
|------|------|
|
|
47
|
-
| `
|
|
51
|
+
| `free` | **全球免运费**(新商户默认),可配置配送天数 |
|
|
48
52
|
| `fixed_only` | 仅使用固定运费区域 |
|
|
49
53
|
| `easyship_only` | 仅使用 Easyship 实时报价 |
|
|
50
54
|
|
|
55
|
+
**免运费模式参数**:
|
|
56
|
+
- `--free-days-min` - 最小配送天数(默认 7)
|
|
57
|
+
- `--free-days-max` - 最大配送天数(默认 14)
|
|
58
|
+
|
|
51
59
|
---
|
|
52
60
|
|
|
53
61
|
## 运费计算
|