siluzan-tso-cli 1.1.16 → 1.1.17-beta.2
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 +2 -1
- package/dist/index.js +3 -3
- package/dist/skill/SKILL.md +3 -0
- package/dist/skill/_meta.json +2 -2
- package/dist/skill/references/account-analytics.md +24 -3
- package/dist/skill/references/accounts.md +3 -1
- package/dist/skill/references/finance.md +5 -5
- package/dist/skill/references/google-analysis-batch.md +2 -0
- package/dist/skill/references/reporting.md +2 -2
- package/dist/skill/references/setup.md +5 -5
- package/dist/skill/references/tso-home.md +1 -1
- package/dist/skill/scripts/install.ps1 +107 -4
- package/dist/skill/scripts/install.sh +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ HTML 报告模板引用以下 CDN:`cdn.tailwindcss.com`、`cdnjs.cloudflare.co
|
|
|
43
43
|
在**用户的目标项目根目录**执行(根据用户使用的助手选择 `--ai`):
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
|
-
npm install -g siluzan-tso-cli
|
|
46
|
+
npm install -g siluzan-tso-cli@beta
|
|
47
47
|
siluzan-tso init --ai cursor # 写入 Cursor(默认)
|
|
48
48
|
siluzan-tso init --ai cursor,claude # 同时写入多个平台
|
|
49
49
|
siluzan-tso init --ai all # 写入所有支持的平台
|
|
@@ -51,6 +51,7 @@ siluzan-tso init -d /path/to/skills # 写入自定义目录
|
|
|
51
51
|
siluzan-tso init --force # 强制覆盖已存在文件
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
+
> **注意**:当前为测试版(1.1.17-beta.2),供内部测试使用。正式发布后安装命令将改为 `npm install -g siluzan-tso-cli`。
|
|
54
55
|
|
|
55
56
|
| 助手 | 建议 `--ai` |
|
|
56
57
|
| ----------------------- | ------------------------------------ |
|
package/dist/index.js
CHANGED
|
@@ -2791,7 +2791,7 @@ var DEFAULT_API_BASE;
|
|
|
2791
2791
|
var init_defaults = __esm({
|
|
2792
2792
|
"src/config/defaults.ts"() {
|
|
2793
2793
|
"use strict";
|
|
2794
|
-
DEFAULT_API_BASE = "https://tso-api.siluzan.com";
|
|
2794
|
+
DEFAULT_API_BASE = "https://tso-api-ci.siluzan.com";
|
|
2795
2795
|
}
|
|
2796
2796
|
});
|
|
2797
2797
|
|
|
@@ -5949,7 +5949,7 @@ var init_google_analysis = __esm({
|
|
|
5949
5949
|
SECTIONS = [
|
|
5950
5950
|
{
|
|
5951
5951
|
name: "overview",
|
|
5952
|
-
description: "\u8D26\u6237\u603B\u89C8 OverviewSectionData",
|
|
5952
|
+
description: "\u8D26\u6237\u603B\u89C8 OverviewSectionData\uFF08\u5B9E\u65F6\uFF0C\u53EF\u67E5\u5F53\u5929\uFF09",
|
|
5953
5953
|
dateMode: "range",
|
|
5954
5954
|
path: (id) => `/reporting/media-account/${id}/OverviewSectionData`
|
|
5955
5955
|
},
|
|
@@ -6075,7 +6075,7 @@ var init_google_analysis = __esm({
|
|
|
6075
6075
|
},
|
|
6076
6076
|
{
|
|
6077
6077
|
name: "campaign-types",
|
|
6078
|
-
description: "\u5E7F\u544A\u7CFB\u5217\u7C7B\u578B\u6C47\u603B campaigns/types-summary",
|
|
6078
|
+
description: "\u5E7F\u544A\u7CFB\u5217\u7C7B\u578B\u6C47\u603B campaigns/types-summary\uFF08\u5B9E\u65F6\uFF0C\u53EF\u67E5\u5F53\u5929\uFF09",
|
|
6079
6079
|
dateMode: "none",
|
|
6080
6080
|
path: (id) => `/reporting/media-account/${id}/campaigns/types-summary`
|
|
6081
6081
|
}
|
package/dist/skill/SKILL.md
CHANGED
|
@@ -24,6 +24,8 @@ allowed-tools: Bash(siluzan-tso:*) Read Write
|
|
|
24
24
|
irm https://unpkg.com/siluzan-tso-cli@latest/dist/skill/scripts/install.ps1 | iex
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
+
Windows 注意:部分 Agent 客户端通过 PowerShell / cmd 代执行命令时存在兼容性问题。若上述命令异常失败,请先安装 [Git for Windows](https://git-scm.com/download/win),然后在 Git Bash 中执行 macOS / Linux / WSL 的 Bash 安装命令。
|
|
28
|
+
|
|
27
29
|
参照 `references/setup.md` 完成安装与配置。
|
|
28
30
|
|
|
29
31
|
---
|
|
@@ -92,6 +94,7 @@ allowed-tools: Bash(siluzan-tso:*) Read Write
|
|
|
92
94
|
### 硬规范
|
|
93
95
|
|
|
94
96
|
- **账户状态 ≠ 广告系列状态**:`stats`/`balance`/`list-accounts` 的 `status` 只表示账户是否可用,系列状态**必须**来自 `ad campaigns`。
|
|
97
|
+
- **数据时效性(实时 vs 每日同步)**:涉及「今天/当天/今日消耗」「实时消耗排行」前,**必须**先看 `references/account-analytics.md` 顶部「数据时效性」表选对接口(`accountsoverview` 系列接口同步昨天数据,不能查今天)。
|
|
95
98
|
- **不确定时读文档**:先读对应 references 或用 `-h` 查看帮助,不要猜参数。
|
|
96
99
|
- **先查账户再操作**:`list-accounts -m [mediaType] -k [mediaCustomerId]`。
|
|
97
100
|
- **使用 `--json-out` 处理数据**:处理顺序:先读 `outlineFile`(schema 描述,扩展名 **`.outline.txt`** 不是 `.json`,**禁止 `require()`**,用 `fs.readFileSync(outlineFile,'utf8')` 取最后一行 TS 式类型字面量即可了解全部字段路径)→ 再让脚本读 `writtenFiles[0]`(真实数据 JSON)做聚合。**outline 通常几百字节、JSON 常见几 MB,先读 outline 能节省 2~3 个数量级的上下文**——尤其多账户多维度场景,直接 `Read` 全量 JSON 几次就把对话窗口塞满了。**禁止**把 outline 当数据、跳过 outline 猜字段、把 outline 内容贴给用户当结论。
|
package/dist/skill/_meta.json
CHANGED
|
@@ -4,6 +4,27 @@
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
## 数据时效性(实时 vs 每日同步)—— 选命令前必读
|
|
8
|
+
|
|
9
|
+
涉及"今天/当天/今日消耗""实时消耗排行"等问题时,**必须**先按此表确认接口口径,否则今天消耗会被误判为 0。
|
|
10
|
+
|
|
11
|
+
| 命令 / 接口 | 时效性 | 能否查"今天" | 典型用途 |
|
|
12
|
+
|---|---|---|---|
|
|
13
|
+
| `google-analysis --sections overview`(Google 网关 `OverviewSectionData`) | **实时** | ✅ 可查当天 | 当天/今日消耗、当天高消耗账号排行 |
|
|
14
|
+
| `google-analysis --sections campaign-types`(`types-summary`) | **实时** | ✅ 可查当天 | 当天系列类型分布 |
|
|
15
|
+
| `google-analysis` 其他维度(`campaigns` / `keywords` / `devices` / ...) | 实时(受 Google Ads API 同步延迟影响) | 可查当天,但当天可能尚未结算 | 周期分析、报告 |
|
|
16
|
+
| `stats`、`balance-scan` 的近 7 日消耗、`accounts-digest`、`list-accounts` 合并消耗(TSO `accountsoverview`) | **每日同步昨天** | ❌ 查今天会全为 0 | 历史回溯、巡检、余额续航估算(口径为"截至昨天") |
|
|
17
|
+
| `balance`(`GetMediaAccountInfo`) | 实时 | — | 仅当前余额,不反映消耗 |
|
|
18
|
+
|
|
19
|
+
**选用规则**:
|
|
20
|
+
|
|
21
|
+
- 「今天/当天/今日消耗」「实时消耗排行」 → 用 `google-analysis(-batch) --sections overview`,`--start` / `--end` 都设为今天
|
|
22
|
+
- 「最近 N 天消耗 / 周报 / 月报 / 余额续航」 → `stats` / `balance-scan` / `accounts-digest`,默认窗口截至昨天即可
|
|
23
|
+
- **禁止**用 `accountsoverview` 系列接口(`stats` / `balance-scan` / `accounts-digest` / `list-accounts` 合并消耗)判断当天消耗
|
|
24
|
+
- **禁止**给当天高消耗场景加 `--min-spend`:该预筛选同样来自 `accountsoverview`,会把今天有消耗的账号当成 0 给筛掉
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
7
28
|
## 默认做法(核心工作流)
|
|
8
29
|
|
|
9
30
|
1. **先确认统计区间**:用户未给明确起止日期时**必须反问**(参见 SKILL.md 时间范围强制反问)。
|
|
@@ -63,7 +84,7 @@
|
|
|
63
84
|
|
|
64
85
|
## Google 账户分析:`google-analysis` 命令
|
|
65
86
|
|
|
66
|
-
> **重要**:`google-analysis` 是统一入口,所有 21 个维度都通过 `--sections` 选取。关键词维度用 `--sections keywords`,**不要**用 `ad keywords`
|
|
87
|
+
> **重要**:`google-analysis` 是统一入口,所有 21 个维度都通过 `--sections` 选取。关键词维度用 `--sections keywords`,**不要**用 `ad keywords` 代替。涉及「今天/当天」消耗的口径见本文顶部「数据时效性」表。
|
|
67
88
|
|
|
68
89
|
```bash
|
|
69
90
|
# 单维度
|
|
@@ -100,7 +121,7 @@ siluzan-tso google-analysis -a <id> --exclude materials,gold-account --json-out
|
|
|
100
121
|
|
|
101
122
|
| 维度 | 说明 |
|
|
102
123
|
|------|------|
|
|
103
|
-
| `overview` |
|
|
124
|
+
| `overview` | 总览(实时,可查当天;当天高消耗账号排行首选) |
|
|
104
125
|
| `keywords` | 关键词;可选 `--limit`、`--no-order-by-cost` |
|
|
105
126
|
| `search-terms` | 搜索词 |
|
|
106
127
|
| `campaigns` | 广告系列 |
|
|
@@ -120,7 +141,7 @@ siluzan-tso google-analysis -a <id> --exclude materials,gold-account --json-out
|
|
|
120
141
|
| `ads-index` | 质量指标 |
|
|
121
142
|
| `final-urls` | 最终到达网址(不传 `--start`/`--end`) |
|
|
122
143
|
| `dimension-summary` | 账户汇总 |
|
|
123
|
-
| `campaign-types` |
|
|
144
|
+
| `campaign-types` | 系列类型(实时,可查当天;不传 `--start`/`--end`) |
|
|
124
145
|
|
|
125
146
|
### stdout 摘要
|
|
126
147
|
|
|
@@ -127,7 +127,9 @@ siluzan-tso balance -m Google -a 6326027735 --json
|
|
|
127
127
|
|
|
128
128
|
---
|
|
129
129
|
|
|
130
|
-
## stats —
|
|
130
|
+
## stats — 查询投放消耗数据(每日同步昨天数据)
|
|
131
|
+
|
|
132
|
+
> **数据时效性**:本接口口径为 `accountsoverview`,每日凌晨同步昨天数据,**不能查今天**。判断「今天/当天/今日消耗」请走 `google-analysis(-batch) --sections overview`。完整时效性表见 `references/account-analytics.md` 顶部。
|
|
131
133
|
|
|
132
134
|
```bash
|
|
133
135
|
siluzan-tso stats -m <媒体类型> [选项]
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
## invoice-info — 发票抬头管理
|
|
9
9
|
|
|
10
|
-
对应页面:`https://www.siluzan.com/v3/foreign_trade/settings/invoiceInformation`
|
|
10
|
+
对应页面:`https://www-ci.siluzan.com/v3/foreign_trade/settings/invoiceInformation`
|
|
11
11
|
|
|
12
12
|
发票抬头是开票申请时使用的公司/企业信息模板,支持三种类型:
|
|
13
13
|
|
|
@@ -133,10 +133,10 @@ siluzan-tso config show
|
|
|
133
133
|
**示例:**
|
|
134
134
|
|
|
135
135
|
```
|
|
136
|
-
- 现金充值(单笔):https://www.siluzan.com/recharge/pay
|
|
137
|
-
- 现金充值(批量):https://www.siluzan.com/recharge/pay_batch
|
|
138
|
-
- 月结充值: https://www.siluzan.com/recharge/accountBillingQuota
|
|
139
|
-
- 丝路赞钱包: https://www.siluzan.com/recharge/siluzanWallet
|
|
136
|
+
- 现金充值(单笔):https://www-ci.siluzan.com/recharge/pay
|
|
137
|
+
- 现金充值(批量):https://www-ci.siluzan.com/recharge/pay_batch
|
|
138
|
+
- 月结充值: https://www-ci.siluzan.com/recharge/accountBillingQuota
|
|
139
|
+
- 丝路赞钱包: https://www-ci.siluzan.com/recharge/siluzanWallet
|
|
140
140
|
```
|
|
141
141
|
|
|
142
142
|
---
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# `google-analysis-batch` —— 多账户 × 多维度 Google 数据批处理引擎
|
|
2
2
|
|
|
3
3
|
> 适用:账户数 ≥ 5 且需拉 ≥ 2 个 google-analysis 维度。**禁止**外层 for-loop 替代。中断后**必须** `resume`,不得重跑 `run`。
|
|
4
|
+
>
|
|
5
|
+
> **数据时效性**:维度的实时 / 每日同步口径见 `references/account-analytics.md` 顶部「数据时效性」表。当天高消耗排行只能用 `--sections overview`,且**禁止**加 `--min-spend`(其预筛选来自非实时 `accountsoverview`)。
|
|
4
6
|
|
|
5
7
|
单 Node 进程,复用 keep-alive,双层并发(账户级 × 维度级),断点续跑,错误自动分类重试。
|
|
6
8
|
|
|
@@ -214,8 +214,8 @@ siluzan-tso report list -m Google --json
|
|
|
214
214
|
|
|
215
215
|
# 第二步:查看 webUrl
|
|
216
216
|
siluzan-tso config show
|
|
217
|
-
# webUrl: https://www.siluzan.com
|
|
217
|
+
# webUrl: https://www-ci.siluzan.com
|
|
218
218
|
|
|
219
219
|
# 第三步:拼接链接(Google 日报)
|
|
220
|
-
# https://www.siluzan.com/media-report/publish/rpt_abc123?culture=zh-CN
|
|
220
|
+
# https://www-ci.siluzan.com/media-report/publish/rpt_abc123?culture=zh-CN
|
|
221
221
|
```
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
## 安装 CLI
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
npm install -g siluzan-tso-cli
|
|
13
|
+
npm install -g siluzan-tso-cli@beta
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
---
|
|
@@ -47,7 +47,7 @@ siluzan-tso config set --api-key <Key> # 或通过 config set 直接写入
|
|
|
47
47
|
siluzan-tso config set --token <Token> # 备用:设置 JWT Token
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
API Key 获取入口:`https://www.siluzan.com/v3/foreign_trade/settings/apiKeyManagement`
|
|
50
|
+
API Key 获取入口:`https://www-ci.siluzan.com/v3/foreign_trade/settings/apiKeyManagement`
|
|
51
51
|
|
|
52
52
|
### 通过环境变量传入凭据(CI/CD 推荐)
|
|
53
53
|
|
|
@@ -82,9 +82,9 @@ siluzan-tso config show
|
|
|
82
82
|
|
|
83
83
|
```
|
|
84
84
|
构建环境 : production
|
|
85
|
-
apiBaseUrl : https://tso-api.siluzan.com
|
|
86
|
-
googleApiUrl : https://googleapi.mysiluzan.com
|
|
87
|
-
webUrl : https://www.siluzan.com
|
|
85
|
+
apiBaseUrl : https://tso-api-ci.siluzan.com
|
|
86
|
+
googleApiUrl : https://googleapi-ci.mysiluzan.com
|
|
87
|
+
webUrl : https://www-ci.siluzan.com
|
|
88
88
|
apiKey : abcd****1234
|
|
89
89
|
```
|
|
90
90
|
|
|
@@ -10,12 +10,14 @@ $ErrorActionPreference = 'Stop'
|
|
|
10
10
|
$PKG_NAME = 'siluzan-tso-cli'
|
|
11
11
|
$CLI_BIN = 'siluzan-tso'
|
|
12
12
|
$SKILL_LABEL = 'Siluzan TSO'
|
|
13
|
-
$INSTALL_CMD = 'npm install -g siluzan-tso-cli'
|
|
14
|
-
$WEB_BASE = 'https://www.siluzan.com'
|
|
13
|
+
$INSTALL_CMD = 'npm install -g siluzan-tso-cli@beta'
|
|
14
|
+
$WEB_BASE = 'https://www-ci.siluzan.com'
|
|
15
15
|
|
|
16
16
|
# -- Constants ----------------------------------------------------------------
|
|
17
|
-
$NODE_MAJOR_MIN
|
|
18
|
-
$NPM_MIRROR
|
|
17
|
+
$NODE_MAJOR_MIN = 18
|
|
18
|
+
$NPM_MIRROR = 'https://registry.npmmirror.com'
|
|
19
|
+
# Git for Windows installer (mirrored on Siluzan CDN; bump version here when needed)
|
|
20
|
+
$GIT_INSTALLER_URL = 'https://staticpn.siluzan.com/assets/git/Git-2.54.0-64-bit.exe'
|
|
19
21
|
|
|
20
22
|
# -- Helpers ------------------------------------------------------------------
|
|
21
23
|
function Write-Info { param([string]$Msg) Write-Host "[OK] $Msg" -ForegroundColor Green }
|
|
@@ -80,6 +82,85 @@ function Install-NodeFallback {
|
|
|
80
82
|
throw 'Node.js is required'
|
|
81
83
|
}
|
|
82
84
|
|
|
85
|
+
# -- Git for Windows ----------------------------------------------------------
|
|
86
|
+
# Some agent clients (Cursor / Claude Code / etc.) have known quirks running
|
|
87
|
+
# PowerShell or cmd commands. We install Git for Windows ahead of time so the
|
|
88
|
+
# user always has a Git Bash fallback to run the equivalent bash installer
|
|
89
|
+
# (`bash <(curl -fsSL .../install.sh)`) when the PowerShell channel misbehaves.
|
|
90
|
+
function Test-GitInstalled {
|
|
91
|
+
return $null -ne (Get-Command git -ErrorAction SilentlyContinue)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function Test-IsAdmin {
|
|
95
|
+
try {
|
|
96
|
+
$id = [Security.Principal.WindowsIdentity]::GetCurrent()
|
|
97
|
+
$principal = New-Object Security.Principal.WindowsPrincipal($id)
|
|
98
|
+
return $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
|
|
99
|
+
} catch {
|
|
100
|
+
return $false
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function Install-Git {
|
|
105
|
+
$tmpFile = Join-Path $env:TEMP 'siluzan-git-installer.exe'
|
|
106
|
+
|
|
107
|
+
Write-Info "Downloading Git for Windows: $GIT_INSTALLER_URL"
|
|
108
|
+
try {
|
|
109
|
+
$prevProgress = $ProgressPreference
|
|
110
|
+
$ProgressPreference = 'SilentlyContinue'
|
|
111
|
+
Invoke-WebRequest -Uri $GIT_INSTALLER_URL -OutFile $tmpFile -UseBasicParsing
|
|
112
|
+
$ProgressPreference = $prevProgress
|
|
113
|
+
} catch {
|
|
114
|
+
Write-Warn "Git installer download failed: $($_.Exception.Message)"
|
|
115
|
+
return $false
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (-not (Test-Path $tmpFile)) {
|
|
119
|
+
Write-Warn 'Git installer file not found after download'
|
|
120
|
+
return $false
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
# Inno Setup silent flags. When not admin we point /DIR to %LOCALAPPDATA% so
|
|
124
|
+
# the installer doesn't try to write to Program Files (which would trigger UAC
|
|
125
|
+
# or just fail). The installer auto-detects ALLUSERS vs CURRENTUSER mode based
|
|
126
|
+
# on whether the current process is elevated, so we don't pass /CURRENTUSER
|
|
127
|
+
# explicitly (not all Git for Windows builds accept that flag).
|
|
128
|
+
$installArgs = @('/VERYSILENT', '/NORESTART', '/NOCANCEL', '/SP-', '/CLOSEAPPLICATIONS', '/RESTARTAPPLICATIONS')
|
|
129
|
+
if (Test-IsAdmin) {
|
|
130
|
+
Write-Info 'Installing Git for Windows system-wide (admin detected)...'
|
|
131
|
+
} else {
|
|
132
|
+
$userDir = Join-Path $env:LOCALAPPDATA 'Programs\Git'
|
|
133
|
+
Write-Info "Installing Git for Windows for current user: $userDir"
|
|
134
|
+
$installArgs += @("/DIR=$userDir")
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
try {
|
|
138
|
+
Start-Process -FilePath $tmpFile -ArgumentList $installArgs -Wait -NoNewWindow
|
|
139
|
+
} catch {
|
|
140
|
+
Write-Warn "Git installer launch failed: $($_.Exception.Message)"
|
|
141
|
+
Remove-Item $tmpFile -ErrorAction SilentlyContinue
|
|
142
|
+
return $false
|
|
143
|
+
}
|
|
144
|
+
Remove-Item $tmpFile -ErrorAction SilentlyContinue
|
|
145
|
+
|
|
146
|
+
Refresh-Path
|
|
147
|
+
if (-not (Test-GitInstalled)) {
|
|
148
|
+
# 安装器有时不会立刻刷新 PATH,按已知路径手动补一次
|
|
149
|
+
$candidates = @(
|
|
150
|
+
(Join-Path $env:LOCALAPPDATA 'Programs\Git\cmd'),
|
|
151
|
+
(Join-Path $env:ProgramFiles 'Git\cmd')
|
|
152
|
+
)
|
|
153
|
+
foreach ($p in $candidates) {
|
|
154
|
+
if (Test-Path (Join-Path $p 'git.exe')) {
|
|
155
|
+
$env:Path = "$p;$env:Path"
|
|
156
|
+
break
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return Test-GitInstalled
|
|
162
|
+
}
|
|
163
|
+
|
|
83
164
|
# -- Main ---------------------------------------------------------------------
|
|
84
165
|
function Main {
|
|
85
166
|
Write-Host ''
|
|
@@ -119,6 +200,23 @@ function Main {
|
|
|
119
200
|
}
|
|
120
201
|
Write-Info 'npm ready'
|
|
121
202
|
|
|
203
|
+
# Git for Windows: pre-install as a Bash fallback path for agent clients
|
|
204
|
+
# whose PowerShell/cmd channel is unreliable. Failure here is non-fatal.
|
|
205
|
+
if (Test-GitInstalled) {
|
|
206
|
+
Write-Info 'Git for Windows already installed (Git Bash fallback ready)'
|
|
207
|
+
} else {
|
|
208
|
+
Write-Warn 'Git for Windows not found, installing as Bash fallback for agent clients...'
|
|
209
|
+
$gitOk = $false
|
|
210
|
+
try { $gitOk = Install-Git } catch { Write-Warn "Git install error: $($_.Exception.Message)" }
|
|
211
|
+
if ($gitOk) {
|
|
212
|
+
Write-Info 'Git for Windows installed (Git Bash fallback ready)'
|
|
213
|
+
} else {
|
|
214
|
+
Write-Warn 'Git for Windows install was skipped or failed; CLI install will continue.'
|
|
215
|
+
Write-Host ' If your agent later fails to run PowerShell commands, install Git manually:' -ForegroundColor DarkGray
|
|
216
|
+
Write-Host " $GIT_INSTALLER_URL" -ForegroundColor DarkGray
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
122
220
|
$currentRegistry = ''
|
|
123
221
|
try { $currentRegistry = (npm config get registry 2>$null).Trim() } catch {}
|
|
124
222
|
if ($currentRegistry -ne $NPM_MIRROR -and $currentRegistry -ne "$NPM_MIRROR/") {
|
|
@@ -160,6 +258,11 @@ function Main {
|
|
|
160
258
|
Write-Host ''
|
|
161
259
|
Write-Host " Update CLI & Skill files: $CLI_BIN update"
|
|
162
260
|
Write-Host ''
|
|
261
|
+
if (Test-GitInstalled) {
|
|
262
|
+
Write-Host ' Tip: if your agent client has trouble running PowerShell/cmd commands later,' -ForegroundColor DarkGray
|
|
263
|
+
Write-Host ' open Git Bash and re-run the equivalent bash installer instead.' -ForegroundColor DarkGray
|
|
264
|
+
Write-Host ''
|
|
265
|
+
}
|
|
163
266
|
Write-Info "Need help? Visit $WEB_BASE"
|
|
164
267
|
Write-Host ''
|
|
165
268
|
}
|
|
@@ -10,8 +10,8 @@ set -euo pipefail
|
|
|
10
10
|
readonly PKG_NAME="siluzan-tso-cli"
|
|
11
11
|
readonly CLI_BIN="siluzan-tso"
|
|
12
12
|
readonly SKILL_LABEL="Siluzan TSO"
|
|
13
|
-
readonly INSTALL_CMD="npm install -g siluzan-tso-cli"
|
|
14
|
-
readonly WEB_BASE="https://www.siluzan.com"
|
|
13
|
+
readonly INSTALL_CMD="npm install -g siluzan-tso-cli@beta"
|
|
14
|
+
readonly WEB_BASE="https://www-ci.siluzan.com"
|
|
15
15
|
|
|
16
16
|
# -- Constants ----------------------------------------------------------------
|
|
17
17
|
readonly NODE_MAJOR_MIN=18
|