siluzan-tso-cli 1.1.62-beta.2 → 1.1.62-beta.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.
package/README.md CHANGED
@@ -51,7 +51,7 @@ siluzan-tso init -d /path/to/skills # 写入自定义目录
51
51
  siluzan-tso init --force # 强制覆盖已存在文件
52
52
  ```
53
53
 
54
- > **注意**:当前为测试版(1.1.62-beta.2),供内部测试使用。正式发布后安装命令将改为 `npm install -g siluzan-tso-cli`。
54
+ > **注意**:当前为测试版(1.1.62-beta.3),供内部测试使用。正式发布后安装命令将改为 `npm install -g siluzan-tso-cli`。
55
55
 
56
56
  | 助手 | 建议 `--ai` |
57
57
  | ----------------------- | ------------------------------------ |
package/dist/index.js CHANGED
@@ -115606,8 +115606,10 @@ function findKeywordEditMismatches(requested, returned, changed) {
115606
115606
  );
115607
115607
  }
115608
115608
  if (changed.maxCpc !== void 0 && typeof returned["maxCPC"] === "number" && returned["maxCPC"] !== Number(requested["maxCPC"])) {
115609
+ const expectedCents = Number(requested["maxCPC"]);
115610
+ const actualCents = returned["maxCPC"];
115609
115611
  mismatches.push(
115610
- `maxCPC\uFF08\u5206\uFF09\uFF1A\u671F\u671B ${String(requested["maxCPC"])}\uFF0C\u5B9E\u9645 ${String(returned["maxCPC"])}`
115612
+ `maxCPC\uFF1A\u671F\u671B ${expectedCents / 100} \u5143\uFF0C\u5217\u8868\u4ECD\u662F ${actualCents / 100} \u5143\u3002\u5173\u952E\u8BCD\u5217\u8868\u6309\u8D26\u6237\u548C\u65E5\u671F\u7F13\u5B58\u7EA6 60 \u79D2\uFF0C\u4E14\u6CA1\u6709 --fresh\uFF0C\u8FD9\u6B21\u56DE\u8BFB\u53EF\u80FD\u4ECD\u662F\u5199\u5165\u524D\u7684\u503C\u3002\u4E0D\u8981\u7ACB\u523B\u91CD\u8DD1 keyword-edit\uFF0C\u4E5F\u4E0D\u8981\u5220\u8BCD\u91CD\u5EFA\u3002\u7EA6 60 \u79D2\u540E\u7528 ad keywords --json-out \u770B\u8BE5 id \u7684 maxCPCYuan\uFF0C\u5DF2\u7ECF\u662F\u76EE\u6807\u503C\u5C31\u5F53\u6210\u529F\u3002`
115611
115613
  );
115612
115614
  }
115613
115615
  if (changed.status !== void 0 && typeof returned["userStatusV2"] === "string" && str3(returned["userStatusV2"]).toLowerCase() !== changed.status.toLowerCase()) {
@@ -117350,10 +117352,11 @@ async function runAdCampaigns(opts) {
117350
117352
  }
117351
117353
  const rawItems = data.data ?? [];
117352
117354
  const items3 = rawItems.map((item) => {
117353
- const budgetYuan = toDisplayMoney(item.budget);
117354
117355
  return {
117355
117356
  ...item,
117356
- budget: budgetYuan,
117357
+ budget: toDisplayMoney(item.budget),
117358
+ targetSpendBidCeilingYuan: toDisplayMoney(item["targetSpend_BidCeilingAmount"]),
117359
+ targetCpaAmountYuan: toDisplayMoney(item["targetCpa_BidingAmount"]),
117357
117360
  statusDisplay: formatGoogleCampaignListStatus(item)
117358
117361
  };
117359
117362
  });
@@ -126572,9 +126575,7 @@ function register21(program2) {
126572
126575
  verbose: opts.verbose
126573
126576
  });
126574
126577
  });
126575
- adCmd.command("campaign-edit").description(
126576
- "\u7F16\u8F91\u641C\u7D22\u5E7F\u544A\u7CFB\u5217\u3002\u540D\u79F0\u3001\u9884\u7B97\u3001\u51FA\u4EF7\u3001\u6295\u653E\u7F51\u7EDC\u90FD\u8D70\u5B57\u6BB5\u7EA7 PATCH\u3002\u81F3\u5C11\u4F20\u4E00\u4E2A\u4FEE\u6539\u9879"
126577
- ).requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").requiredOption("--id <campaignId>", "\u5E7F\u544A\u7CFB\u5217 ID").option("--name <name>", "\u65B0\u540D\u79F0").option(
126578
+ adCmd.command("campaign-edit").description("\u7F16\u8F91\u641C\u7D22\u5E7F\u544A\u7CFB\u5217\u3002\u540D\u79F0\u3001\u9884\u7B97\u3001\u51FA\u4EF7\u3001\u6295\u653E\u7F51\u7EDC\u90FD\u8D70\u5B57\u6BB5\u7EA7 PATCH\u3002\u81F3\u5C11\u4F20\u4E00\u4E2A\u4FEE\u6539\u9879").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").requiredOption("--id <campaignId>", "\u5E7F\u544A\u7CFB\u5217 ID").option("--name <name>", "\u65B0\u540D\u79F0").option(
126578
126579
  "--budget <amount>",
126579
126580
  "\u65B0\u9884\u7B97\uFF0C\u4E3B\u5E01\u79CD\u91D1\u989D\uFF08\u5982 100 \u8868\u793A \xA5100\uFF1B\u652F\u6301\u5C0F\u6570\uFF1BCLI \u5185\u90E8\u81EA\u52A8 \xD7100 \u5199\u5165\u300C\u5206\u300D\u5B57\u6BB5\uFF09",
126580
126581
  parseFloat
@@ -126708,7 +126709,7 @@ function register21(program2) {
126708
126709
  '\u65B0\u5339\u914D\u7C7B\u578B\uFF1ABroad | Phrase | Exact\uFF08\u5199 matchTypeV2\uFF0C\u5E76\u9ED8\u8BA4\u540C\u6B65\u6539\u5199 keywordText \u4E3A\u8BCD\u5E72/"\u8BCD"/[\u8BCD] \u4EE5\u7B26\u5408\u7F51\u5173\u63A8\u65AD\uFF09'
126709
126710
  ).option(
126710
126711
  "--max-cpc <n>",
126711
- "\u6700\u9AD8\u6BCF\u6B21\u70B9\u51FB\u8D39\u7528 maxCPC\uFF0C\u4E3B\u5E01\u79CD\u91D1\u989D\uFF08\u5982 10 \u8868\u793A \xA510\uFF1BCLI \u5185\u90E8 \xD7100 \u5199\u5165\u300C\u5206\u300D\u5B57\u6BB5\uFF0C\u4E0E adgroup-edit --max-cpc \u540C\u53E3\u5F84\uFF1B0 \u8868\u793A\u6309\u5E73\u53F0/\u8BA1\u5212\u9ED8\u8BA4\uFF09"
126712
+ "\u6700\u9AD8\u6BCF\u6B21\u70B9\u51FB\u8D39\u7528\uFF0C\u4E3B\u5E01\u79CD\u91D1\u989D\uFF08\u5982 10 \u8868\u793A \xA510\uFF1BCLI \xD7100 \u5199\u5165\u30020 \u6E05\u7A7A\uFF0C\u56DE\u5230\u5E7F\u544A\u7EC4\u51FA\u4EF7\uFF0C\u4E0D\u662F\u5199\u6210 0 \u5143\uFF09"
126712
126713
  ).option("--final-url <url>", "\u5173\u952E\u8BCD\u7EA7\u6700\u7EC8\u5230\u8FBE\u7F51\u5740 finalURL").option("--status <Enabled|Paused>", "\u7528\u6237\u72B6\u6001\uFF08\u5199\u5165 userStatusV2\uFF0C\u4E0E Web \u5173\u952E\u8BCD\u5F00\u5173\u4E00\u81F4\uFF09").option("--start <date>", "\u5217\u8868\u67E5\u8BE2\u8D77\u59CB\u65E5\u671F YYYY-MM-DD").option("--end <date>", "\u5217\u8868\u67E5\u8BE2\u7ED3\u675F\u65E5\u671F YYYY-MM-DD").option("-t, --token <token>", "Auth Token").option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
126713
126714
  async (opts) => {
126714
126715
  if (opts.matchType && !["Broad", "Phrase", "Exact"].includes(opts.matchType)) {
@@ -146682,10 +146683,8 @@ function playbookCodeFatal(cmd) {
146682
146683
  };
146683
146684
  const replacement = known[key];
146684
146685
  if (replacement) {
146685
- return fatal(
146686
- `\u274C \`${cmd}\` \u662F\u8DEF\u7531\u7F16\u53F7\uFF0C\u4E0D\u662F\u547D\u4EE4\u3002\u8BF7\u6539\u8DD1\uFF1A
146687
- ${replacement}`
146688
- );
146686
+ return fatal(`\u274C \`${cmd}\` \u662F\u8DEF\u7531\u7F16\u53F7\uFF0C\u4E0D\u662F\u547D\u4EE4\u3002\u8BF7\u6539\u8DD1\uFF1A
146687
+ ${replacement}`);
146689
146688
  }
146690
146689
  return fatal(
146691
146690
  `\u274C \`${cmd}\` \u662F\u8DEF\u7531\u7F16\u53F7\uFF0C\u4E0D\u662F\u547D\u4EE4\u3002\u8D26\u6237\u5217\u8868\u7528 list-accounts\uFF0C\u591A\u6237\u4F59\u989D\u7528 balance-scan\uFF0C\u591A\u6237\u6D88\u8017/CPA \u7528 accounts-digest\u3002\u5176\u5B83\u7F16\u53F7\u5148 Read SKILL \u8DEF\u7531\u8868\u3002`
@@ -146718,6 +146717,36 @@ function loginCustomerFlagIssue(args) {
146718
146717
  }
146719
146718
  return null;
146720
146719
  }
146720
+ var EDIT_WITHOUT_JSON_OUT = {
146721
+ "adgroup-edit": "ad groups -a <id> --fresh --json-out <dir>\uFF08\u8BFB maxCPCAmountYuan / targetCpaAmountYuan\uFF09",
146722
+ "keyword-edit": "ad keywords -a <id> --json-out <dir>\uFF08\u8BFB maxCPCYuan\u3002\u5217\u8868\u6CA1\u6709 --fresh\uFF0C\u7F13\u5B58\u7EA6 60 \u79D2\uFF09",
146723
+ "ad-edit": "ad list -a <id> --json-out <dir>"
146724
+ };
146725
+ function adEditJsonOutIssue(args) {
146726
+ if (args[0] !== "ad") return null;
146727
+ const sub = args[1];
146728
+ const verify = sub ? EDIT_WITHOUT_JSON_OUT[sub] : void 0;
146729
+ if (!verify) return null;
146730
+ const hasJsonOut = args.some((a) => a === "--json-out" || a.startsWith("--json-out="));
146731
+ if (!hasJsonOut) return null;
146732
+ return fatal(
146733
+ `\u274C \`${sub}\` \u6CA1\u6709 --json-out\u3002\u5E26\u4E0A\u5B83\u4F1A\u5728\u8BF7\u6C42\u53D1\u51FA\u524D\u5931\u8D25\uFF0C\u6539\u52A8\u6CA1\u6709\u63D0\u4EA4\u3002
146734
+ \u53BB\u6389 --json-out \u518D\u8DD1\u540C\u4E00\u6761\uFF08\u5199\u64CD\u4F5C\u4ECD\u8981 --commit\uFF09\u3002\u6838\u5BF9\uFF1Asiluzan-tso ${verify}`
146735
+ );
146736
+ }
146737
+ var LIST_WITHOUT_ID = /* @__PURE__ */ new Set(["campaigns", "groups", "keywords", "list"]);
146738
+ function adListIdFilterIssue(args) {
146739
+ if (args[0] !== "ad") return null;
146740
+ const sub = args[1];
146741
+ if (!sub || !LIST_WITHOUT_ID.has(sub)) return null;
146742
+ const hasId = args.some(
146743
+ (a) => a === "--id" || a.startsWith("--id=") || a === "--campaign-id" || a.startsWith("--campaign-id=")
146744
+ );
146745
+ if (!hasId) return null;
146746
+ return fatal(
146747
+ `\u274C \`ad ${sub}\` \u4E0D\u80FD\u6309 --id \u8FC7\u6EE4\u3002\u53BB\u6389 --id\uFF0C--json-out <dir> \u843D\u76D8\u540E\u5728 JSON \u91CC\u6309 id \u6311\u4E00\u6761\u3002`
146748
+ );
146749
+ }
146721
146750
  function agentCompatFatalMessage(argv) {
146722
146751
  const args = argv.slice(2);
146723
146752
  if (args.includes("--period") || args.some((a) => a.startsWith("--period="))) {
@@ -146752,6 +146781,10 @@ function agentCompatFatalMessage(argv) {
146752
146781
  "\u274C `ad \u2026` \u5B50\u547D\u4EE4\u6CA1\u6709 `-m/--media`\uFF0C\u8D26\u6237\u7528 `-a/--account <mediaCustomerId>`\u3002\n \u5355\u6237\uFF1Asiluzan-tso ad campaigns -a <id> --start <\u65E5> --end <\u65E5> --json-out ./snap\n \u5168\u6237\u5F53\u65E5\u8D85\u9884\u7B97/\u7A7A\u8017\u7194\u65AD\uFF1Asiluzan-tso guard budget-circuit|zero-conv -m Google --json-out ./snap"
146753
146782
  );
146754
146783
  }
146784
+ const editWithoutJsonOut = adEditJsonOutIssue(args);
146785
+ if (editWithoutJsonOut) return editWithoutJsonOut;
146786
+ const listIdFilter = adListIdFilterIssue(args);
146787
+ if (listIdFilter) return listIdFilter;
146755
146788
  if (cmd === "list" && (args.length === 1 || args[1]?.startsWith("-"))) {
146756
146789
  return fatal(
146757
146790
  "\u274C \u6CA1\u6709\u9876\u5C42 `list` \u547D\u4EE4\u3002\u67E5\u8BE2\u5E7F\u544A\u8D26\u6237\u5217\u8868\u8BF7\u7528\uFF1A\n siluzan-tso list-accounts [-m Google] [-k <id\u6216\u5173\u952E\u5B57>] --json-out <dir>"
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "slug": "siluzan-tso",
3
- "version": "1.1.62-beta.2",
4
- "publishedAt": 1793277242701
3
+ "version": "1.1.62-beta.3",
4
+ "publishedAt": 1793279032165
5
5
  }
@@ -46,6 +46,10 @@ siluzan-tso ad campaigns -a <accountId> [--start <YYYY-MM-DD>] [--end <YYYY-MM-D
46
46
 
47
47
  落盘 JSON 中 **`budget` 为日预算**(主币种「元」,CLI 已 ÷100),另有 **`statusV2`**(`Enabled`/`Paused`/`Removed`)与 **`statusDisplay`**(`{statusV2}·日程文案`,如 `Enabled·有效`、`Enabled·投放期已结束`、`Removed·已删除`)。
48
48
 
49
+ 同对象里 **`targetSpendBidCeilingYuan`**、**`targetCpaAmountYuan`** 也是元,与 `--bid-ceiling` / `--target-cpa` 同口径。`targetSpend_BidCeilingAmount`、`targetCpa_BidingAmount` 仍是分(`1` = 0.01 元),不要填回写参数。`targetRoas` 是倍数,不是金额。
50
+
51
+ 本命令**没有** `--id`。要看一条,落盘后按 `id` 过滤。
52
+
49
53
  > **消歧**:`statusDisplay` 含「投放期已结束」**不是**系列已删除——以 **`statusV2`** 为准;仅 `Removed` 才不可在其下新建组/广告。日程结束仍可 `ad-create`(是否投放另看预算与系列开关)。
50
54
 
51
55
  命令名:列表是 **`ad campaigns`**(兼容别名 `campaign-list`),**没有** `google-ads` 命名空间。`--json-out` **必须带路径**(落盘,勿管道 stdout)。
@@ -53,7 +57,7 @@ siluzan-tso ad campaigns -a <accountId> [--start <YYYY-MM-DD>] [--end <YYYY-MM-D
53
57
  带 `--start` / `--end` 时,同行的 **`spend` / `impressions` / `clicks` / `conversions` / `conversionsValue` 为该闭区间合计**(**不是**日消耗)。`conversionsValue` 是账户币种的转化价值,不是转化次数。报告写转化价值或 ROAS 时用它(ROAS = `conversionsValue` / `spend`)。`ad groups`、`ad list`、`ad keywords`、`ad search-terms` 在同一日期窗口下也返回该字段。
54
58
  与日预算比较「是否超预算」时,**必须** `start=end=统计日`;多日窗口须先 ÷ 天数或改用 `balance-scan.dailySpend` / `overview.averageDailyCost` 再谈「日均」。
55
59
 
56
- > **缓存**:网关侧此列表按 `账户 + 日期区间` 缓存 60 秒(Redis)。若刚 `campaign-create` / `campaign-edit` / `campaign-status` / `campaign-delete` 后立刻查询想看到最新结果,加 `--fresh` 跳过缓存(网关 `newest=true`);日常巡检/报表不需要,留空更省配额。
60
+ > **缓存**:网关侧此列表按 `账户 + 日期区间` 缓存 60 秒(Redis)。若刚 `campaign-create` / `campaign-edit` / `campaign-status` / `campaign-delete` 后立刻查询想看到最新结果,加 `--fresh` 跳过缓存(网关 `newest=true`);日常巡检/报表不需要,留空更省配额。区间不要拉到跨很多年:可能 500,正文含 `authToken` 也不是登录失效,缩短到近 30 天再查,不要据此 `reauth`。
57
61
 
58
62
  ### 启停
59
63
 
@@ -185,7 +189,7 @@ siluzan-tso ad ad-delete -a <accountId> --id <adId>
185
189
  siluzan-tso ad keywords -a <accountId> [--negative] [--start/--end <date>] [--json-out ./snap]
186
190
  ```
187
191
 
188
- 带日期时行上有 `conversionsValue`(账户币种的转化价值,不是 `conversions` 次数)。`--json-out` 里直接读这个字段;终端表「转化价值」列在字段缺失时为「—」。否定关键词名单没有这个指标。
192
+ 带日期时行上有 `conversionsValue`(账户币种的转化价值,不是 `conversions` 次数)。`--json-out` 里直接读这个字段;终端表「转化价值」列在字段缺失时为「—」。否定关键词名单没有这个指标。出价读 `maxCPCYuan`(元)。本列表按账户和日期缓存约 60 秒,**没有** `--fresh`,也**没有** `--id`。`keyword-edit` 回读报「列表仍是」时,等约 60 秒再看 `maxCPCYuan`,不要立刻重跑编辑。
189
193
 
190
194
  ### 添加关键词
191
195
 
@@ -23,8 +23,8 @@
23
23
  ## 写操作硬纪律(Agent 易踩)
24
24
 
25
25
  - **必须** `--commit "…"`;漏了会直接失败。
26
- - 列表命令:`ad campaigns` / `ad groups` / `ad list` / `ad keywords`(**没有** `google-ads`、没有必用 `campaign-list`;`campaign-list` 仅为 `campaigns` 别名)。
27
- - `--json-out <path>`:**路径必填**,JSON 落盘;禁止 `--json-out` 裸用或管道 stdout。
26
+ - 列表命令:`ad campaigns` / `ad groups` / `ad list` / `ad keywords`(**没有** `google-ads`、没有必用 `campaign-list`;`campaign-list` 仅为 `campaigns` 别名)。这四条**没有** `--id`,单条在落盘 JSON 里按 `id` 过滤。
27
+ - `--json-out <path>`:**路径必填**,JSON 落盘;禁止 `--json-out` 裸用或管道 stdout。`adgroup-edit`、`keyword-edit`、`ad-edit` **没有**这个参数,加上会在请求发出前失败。核对用对应列表。
28
28
  - 系列 `statusDisplay` 含「投放期已结束」≠ 已删除;以 JSON **`statusV2`** 为准(见 `google-ads-read.md`)。
29
29
  - **勿创建 Display**:`campaign-create` / `ad-create` 仅面向 Search(RSA);PMax 走 `pmax-*`。
30
30
 
@@ -71,7 +71,7 @@
71
71
 
72
72
  **PMax**:`ad pmax-create` **同步**返回 `campaignId`、`assetGroupId`、`budgetId`;无 `ad batch get/diff`。创建接口 400 才续跑:把比这次请求多出来的非空编号写回同一份 JSON,内容不改,再执行一次。首次创建不填这三个字段。已经 200、只是扩展或视频失败时不要再 `pmax-create`。详见 `pmax-api.md`。
73
73
 
74
- **金额**:JSON 中 `budget`、`targetCpa_BidingAmount` 填主币种**元**;CLI 提交前 ×100(与 `ad campaigns` 列表 `budget` 口径一致)。
74
+ **金额**:JSON 中 `budget`、`targetCpa_BidingAmount` 填主币种**元**;CLI 提交前 ×100(与 `ad campaigns` 列表 `budget` 口径一致)。`pmax-get` 返回的 `budget`、`targetCpa_BidingAmount` 仍是分(`500` = 5 元)。`pmax-edit --budget` / `--target-cpa` 填元,不要把 get 里的分填回去。`pmax-edit` 退出码 0 只表示请求被接受,改完用 `pmax-get` 核对。资产组 `statusV2` 为 `Removed` 时不要再 `pmax-asset-group-edit`。
75
75
 
76
76
  **图片**:配置 `imagePaths`(相对 JSON 文件目录)或 `marketingImageBase64` / `squareMarketingImageBase64` / `logoImageBase64`。`pmax-validate` 会自动校验图片尺寸(最小值 / 推荐值 / 宽高比 ±2% / 文件大小 ≤5120 KB)。如需将任意图片转为合规素材,用 `ad pmax-image-convert`(`marketing` / `square` / `logo` 三种格式,sharp 处理,居中裁切)。
77
77
 
@@ -260,7 +260,7 @@ siluzan-tso ad campaign-edit -a <accountId> --id <campaignId> \
260
260
  --bidding TARGET_CPA --target-cpa 80
261
261
  ```
262
262
 
263
- 相对运算:先 `ad campaigns --json-out ./snap` 读 `budget`(已为主币种元)、`biddingStrategyTypeV2`,再传入。
263
+ 相对运算:先 `ad campaigns --json-out ./snap` 读 `budget`、`targetSpendBidCeilingYuan`、`targetCpaAmountYuan`(都已是元)和 `biddingStrategyTypeV2`,再传入。不要读 `targetSpend_BidCeilingAmount` / `targetCpa_BidingAmount`(仍是分)。
264
264
 
265
265
  `campaign-edit` 的名称、预算、出价、投放网络,以及 `campaign-status`,走字段级 PATCH(`writeScope=search-field-patch`)。请求只带本次传入的字段,没传的字段保持原样。金额仍是主币种元,CLI ×100 写入网关「分」。`--search-network` / `--content-network` 传 `true` 或 `false`,关闭传 `false`,不能传空。`budgetShared=true` 时本命令直接拒绝 `--budget`,不会改共享预算。PMax 不要用本命令。
266
266
 
@@ -354,7 +354,7 @@ siluzan-tso ad keyword-delete -a <accountId> --id <keywordId> --adgroup-id <adGr
354
354
 
355
355
  ## ad keyword-edit — 搜索关键词编辑
356
356
 
357
- 只改 `--final-url` / `--max-cpc` / `--status` 时走字段级 PATCH,原地更新,`id` 与历史数据保留。`--final-url` 传空会清空关键词网址,回到广告自己的网址。改 `--text` / `--match-type`(Google 侧词面与匹配类型不可变)仍走批量 PUT,会新建并删除旧词,`id` 变化时 CLI 会提示。改 `--final-url` / `--max-cpc` / `--status` 后 CLI 会重新拉列表回读实际值,只有回读一致才输出 ✅;未生效或回读失败则报错退出。此时**禁止**自行改用 `keyword-delete` + `keyword-create`,也禁止直调网关删除重建(会丢失 id 与历史数据),哪怕只改一条也不行。应停下来告知用户「平台未生效、需反馈平台」,可另给 Google Ads Editor 导入清单作为替代方案。
357
+ 只改 `--final-url` / `--max-cpc` / `--status` 时走字段级 PATCH,原地更新,`id` 与历史数据保留。`--final-url` 传空会清空关键词网址,回到广告自己的网址。改 `--text` / `--match-type`(Google 侧词面与匹配类型不可变)仍走批量 PUT,会新建并删除旧词,`id` 变化时 CLI 会提示。改 `--final-url` / `--max-cpc` / `--status` 后 CLI 会重新拉列表回读。本命令没有 `--json-out`。关键词列表按账户和日期缓存约 60 秒,且没有 `--fresh`:回读报「列表仍是」时,先等约 60 秒再看 `maxCPCYuan`。已经是目标值就当成功,**不要**立刻重跑,**不要** `keyword-delete` 后重建。等过缓存仍是旧值,再告诉用户平台未生效。
358
358
 
359
359
  ```bash
360
360
  siluzan-tso ad keyword-edit \
@@ -31,7 +31,10 @@ Meta / Facebook 线索广告走 **`meta-ad`(W13)**,**禁止**用本命令
31
31
 
32
32
  - **广告类型**:仅 Search + PMax;**不支持 Display**(见上文「支持的广告类型」)。
33
33
  - **Search 改字段**:`campaign-status`、`campaign-edit` 的名称/预算/出价/投放网络、`adgroup-status` / `adgroup-rename` / `adgroup-edit`、`keyword-status`、`keyword-edit` 的状态/出价/网址、`ad-status` / `ad-edit` 都是字段级 PATCH,只写本次参数。词面和匹配类型仍是批量 PUT。关闭搜索合作伙伴或展示网络传 `--search-network false` / `--content-network false`。PMax 用 `pmax-edit`,不要用 `campaign-edit`。
34
- - **命令名**:系列列表是 `ad campaigns`(别名 `campaign-list`),**禁止** `ad-campaigns` / `campaign list`。`balance`/`stats` 须 `-m Google`。
34
+ - **命令名**:系列列表是 `ad campaigns`(别名 `campaign-list`),**禁止** `ad-campaigns` / `campaign list`。`balance`/`stats` 须 `-m Google`。`adgroup-edit` / `keyword-edit` / `ad-edit` 没有 `--json-out`。`ad campaigns|groups|keywords|list` 没有 `--id`。
35
+ - **列表金额**:`ad campaigns` 的 `budget`、`targetSpendBidCeilingYuan`、`targetCpaAmountYuan` 是元,与 `--budget` / `--bid-ceiling` / `--target-cpa` 同口径。同对象的 `targetSpend_BidCeilingAmount`、`targetCpa_BidingAmount` 仍是分(`1` = 0.01 元),禁止填回写参数。`ad groups` 只读 `maxCPCAmountYuan` / `targetCpaAmountYuan`。`pmax-get` 的 `budget` 仍是分(`500` = 5 元),`pmax-edit --budget` 填元。
36
+ - **关键词改价回读**:`keyword-edit` 报「列表仍是」时,列表缓存约 60 秒且没有 `--fresh`。不要立刻重跑,不要删词重建。等约 60 秒再看 `maxCPCYuan`。`--max-cpc 0` 是清空并回到广告组出价。广告组 `--target-cpa 0` 同样是清空;`--max-cpc` 必须大于 0。
37
+ - **日期 500**:列表默认近 30 天。区间过长返回 500 且正文含 `authToken` 时,不是登录失效,缩短区间再查,不要据此 `reauth`。
35
38
  - **Google 客户 ID(CID)带连字符**:UI / 用户口述常为 `123-456-7890`,平台 `mediaCustomerId` 与 Google 网关路径需要 `1234567890`。`ad campaigns` / `ad groups` / `ad list` 等 `-a` 与 JSON 顶层 `account` **可带连字符**(CLI 自动去掉)。若错误为 `HTTP 403:123-456-7890`(回显带横杠),先换纯数字重试,**禁止**据此直接判断 OAuth 过期或 `reauth`。
36
39
  - **禁止臆测授权过期**:`ad *` / geo / 拉数出现 403/500 时,**禁止**对用户说「授权可能过期」。须核验 ID 后执行 `account check-access -a <mediaCustomerId>`,仅当 `reauth_required`(或与 `invalidOAuthToken=true` 交叉确认)才走重授权;无激活字段时禁止谈套餐。见 [`accounts-permissions.md`](../accounts/accounts-permissions.md)。
37
40
  - **预算投放**:`BudgetBudgetDeliveryMethodV2` 默认用 `STANDARD`;`ACCELERATED` 多数账户会被 Google 拒(validate 警告)。
@@ -53,17 +53,15 @@ mkdir -p ./snap-scale && siluzan-tso google-analysis -a <mediaCustomerId> --sect
53
53
  ## 最终操作
54
54
 
55
55
  > **金额单位(关键)**:`ad campaign-edit` / `ad adgroup-edit` 所有金额参数均为 **主币种金额**(如 `100` 表示 ¥100,支持小数 `10.5`);CLI 内部自动 `Math.round(value × 100)` 写入「分」字段。详见 `references/google-ads/google-ads-write.md`「ad campaign-edit」金额单位说明。
56
- > **必须先用 `*Display` 字段取主币种当前值,加减后再传回**;不要把 `budget` / `targetCpaAmount` / `maxCPCAmount` 这些"分"字段当作主币种传给 CLI。
56
+ > 系列列表读 `budget`、`targetSpendBidCeilingYuan`、`targetCpaAmountYuan`(已是元)。组列表读 `maxCPCAmountYuan`、`targetCpaAmountYuan`。不要读 `targetSpend_BidCeilingAmount` / `targetCpa_BidingAmount`(分),也不要再 ÷100。
57
57
 
58
58
  **提高系列日预算**(在原值基础上 +10 元的写法):
59
59
 
60
60
  ```bash
61
- # 1) GET 取主币种当前值
62
- CUR=$(siluzan-tso ad campaigns -a <mediaCustomerId> --json-out ./snap | node -e '...筛选 budget(元)')
63
- # 2) 主币种 + 10
64
- NEW=$(node -e "console.log((${CUR} + 10).toFixed(2))")
65
- # 3) 主币种金额传回
66
- siluzan-tso ad campaign-edit -a <mediaCustomerId> --id <campaignId> --budget ${NEW}
61
+ # 1) 落盘后用代码读 budget(元)。不要把 --json-out 管道给 node
62
+ siluzan-tso ad campaigns -a <mediaCustomerId> --json-out ./snap
63
+ # 2) 主币种 + 10,再传回
64
+ siluzan-tso ad campaign-edit -a <mediaCustomerId> --id <campaignId> --budget <新预算元>
67
65
  ```
68
66
 
69
67
  **上调系列目标 CPA**(若策略为 tCPA 等):
@@ -78,7 +76,7 @@ siluzan-tso ad campaign-edit -a <mediaCustomerId> --id <campaignId> --target-cpa
78
76
  siluzan-tso ad adgroup-edit -a <mediaCustomerId> --id <adGroupId> --target-cpa <主币种金额>
79
77
  ```
80
78
 
81
- 写前务必先 **`ad campaigns --json-out ./snap` / `ad groups --json-out ./snap`** 取当前值,**读取 `*Display` 字段**(主币种)后按配置比例计算,再以主币种金额传回。
79
+ 写前务必先 **`ad campaigns --json-out ./snap` / `ad groups --json-out ./snap`** 取当前值。系列用 `budget` / `targetCpaAmountYuan`,组用 `targetCpaAmountYuan`(都是元),按配置比例计算后再传回。
82
80
 
83
81
  ---
84
82
 
@@ -89,7 +87,7 @@ siluzan-tso ad campaigns -a <mediaCustomerId> --start <…> --end <…> --json-o
89
87
  mkdir -p ./snap-scale && siluzan-tso google-analysis -a <mediaCustomerId> --sections campaigns --start <…> --end <…> --json-out ./snap-scale
90
88
  ```
91
89
 
92
- 确认 **`budget`**(元)、**`targetCpa_BidingAmount`**(或组上 **`targetCpaAmount`**)与 **`statusV2`** 符合预期。
90
+ 确认 **`budget`**、**`targetCpaAmountYuan`**(组上同名字段)与 **`statusV2`** 符合预期。刚改完的系列/组列表加 `--fresh`;关键词列表没有 `--fresh`。
93
91
 
94
92
  ---
95
93
 
@@ -43,7 +43,7 @@
43
43
  | 日预算与「当日」费用比 | **仅当** `--start` 与 `--end` 为**同一统计日**时,才可用 `spend` 对比 `budget`;**禁止**用多日 `spend` 去除以或对比日预算(会把周/月合计误当成「一天花了这么多」) |
44
44
  | 转化次数 | **`conversions`**(窗口内合计) |
45
45
  | 实际 CPA | 宿主侧 **`spend / conversions`**(同窗口合计;`conversions` 为 0 时不做 CPA 判断) |
46
- | 目标 CPA(系列 / 组) | 系列列表 JSON 中的 **`targetCpa_BidingAmount`** 等;组列表 **`ad groups --json-out ./snap`** 中的 **`targetCpaAmount`**(写入口径见 `references/google-ads/google-ads-write.md`「广告组编辑」) |
46
+ | 目标 CPA(系列 / 组) | 系列列表 JSON 的 **`targetCpaAmountYuan`**(元);组列表 **`targetCpaAmountYuan`**。不要读系列上的 `targetCpa_BidingAmount`(分) |
47
47
  | 日均消耗(续航用) | 用 `balance-scan` 的 **`dailySpend`**(近 7 日合计/7),或自算 `spend / 活跃天数`;**禁止**把多日 `spend` 直接当「日消耗」 |
48
48
 
49
49
  > **硬约束(自动化 / 预警必读)**:凡带 `--start` / `--end` 的读命令,返回的 `spend` / `impressions` / `clicks` / `conversions` 均为**该闭区间合计**。要「一天的消耗」必须 `start=end=该日`,或显式 `合计 ÷ 天数`;要「日均」用 `balance-scan.dailySpend` / `overview.averageDailyCost`。
@@ -129,7 +129,7 @@ siluzan-tso ad campaign-status -a <mediaCustomerId> --id <campaignId> --status E
129
129
  3. 对候选对象:
130
130
  - `conversions`(窗口内)**≥ 3**
131
131
  - `actual_cpa = spend / conversions`(`conversions > 0`)
132
- - 读取 **目标 CPA**(系列:`targetCpa_BidingAmount` 或 JSON 中实际键;组:`targetCpaAmount`);与 **`actual_cpa`** 同单位后再比。
132
+ - 读取 **目标 CPA**(系列:`targetCpaAmountYuan`;组:`targetCpaAmountYuan`,都是元)。`spend` 已是账户币种,与这两个字段同单位后再比。不要用 `targetCpa_BidingAmount`(分)。
133
133
  - **IF** `actual_cpa > target_cpa * spike_threshold`(如 `1.3`),则进入写操作。
134
134
 
135
135
  ### 最终操作
@@ -160,10 +160,10 @@ siluzan-tso ad adgroup-edit -a <mediaCustomerId> --id <adGroupId> --max-cpc <主
160
160
 
161
161
  ### 写后复核
162
162
 
163
- 再次 **`ad campaigns --json-out ./snap`** 或 **`ad groups --json-out ./snap`**:
163
+ 再次 **`ad campaigns --json-out ./snap`** 或 **`ad groups --json-out ./snap`**(刚改完系列/组加 `--fresh`):
164
164
 
165
- - 优先比对 **`*Display` 字段**(主币种)与预期主币种金额一致;
166
- - 整数字段 `targetCpa_BidingAmount` / `targetCpaAmount` / `maxCPCAmount` / `budget` 应等于 `主币种 × 100` 后的整数。
165
+ - 系列比对 `budget`、`targetSpendBidCeilingYuan`、`targetCpaAmountYuan`(已是元)。不要用 `targetSpend_BidCeilingAmount` / `targetCpa_BidingAmount`(分),也不要再 ×100。
166
+ - 组只比对 `maxCPCAmountYuan`、`targetCpaAmountYuan`。出口里没有 `maxCPCAmount` / `targetCpaAmount`。
167
167
 
168
168
  ### CLI 能力摘要
169
169
 
@@ -9,7 +9,7 @@ $ErrorActionPreference = 'Stop'
9
9
  # -- Package info (injected at build time) ------------------------------------
10
10
  $PKG_NAME = 'siluzan-tso-cli'
11
11
  # PKG_VERSION 锁定到与本脚本同批构建产物一致的版本,避免与 dist/skill 错位
12
- $PKG_VERSION = '1.1.62-beta.2'
12
+ $PKG_VERSION = '1.1.62-beta.3'
13
13
  $CLI_BIN = 'siluzan-tso'
14
14
  $SKILL_LABEL = 'Siluzan TSO'
15
15
  $INSTALL_CMD = 'npm install -g siluzan-tso-cli@beta'
@@ -9,7 +9,7 @@ set -euo pipefail
9
9
  # -- Package info (injected at build time) ------------------------------------
10
10
  readonly PKG_NAME="siluzan-tso-cli"
11
11
  # PKG_VERSION 锁定到与本脚本同批构建产物一致的版本,避免与 dist/skill 错位
12
- readonly PKG_VERSION="1.1.62-beta.2"
12
+ readonly PKG_VERSION="1.1.62-beta.3"
13
13
  readonly CLI_BIN="siluzan-tso"
14
14
  readonly SKILL_LABEL="Siluzan TSO"
15
15
  readonly INSTALL_CMD="npm install -g siluzan-tso-cli@beta"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "siluzan-tso-cli",
3
- "version": "1.1.62-beta.2",
3
+ "version": "1.1.62-beta.3",
4
4
  "description": "Siluzan 广告账户管理 CLI — 查询账户、余额、消耗数据,管理绑定关系与充值。",
5
5
  "keywords": [
6
6
  "ad-account",