siluzan-cso-cli 1.1.12-beta.1 → 1.1.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.
package/README.md CHANGED
@@ -42,7 +42,7 @@
42
42
  在**用户的目标项目根目录**执行(根据用户使用的助手选择 `--ai`):
43
43
 
44
44
  ```bash
45
- npm install -g siluzan-cso-cli@beta
45
+ npm install -g siluzan-cso-cli
46
46
  siluzan-cso init --ai cursor # 写入 Cursor(默认)
47
47
  siluzan-cso init --ai cursor,claude # 同时写入多个平台
48
48
  siluzan-cso init --ai all # 写入所有支持的平台
@@ -50,7 +50,6 @@ siluzan-cso init -d /path/to/skills # 写入自定义目录
50
50
  siluzan-cso init --force # 强制覆盖已存在文件
51
51
  ```
52
52
 
53
- > **注意**:当前为测试版(1.1.12-beta.1),供内部测试使用。正式发布后安装命令将改为 `npm install -g siluzan-cso-cli`。
54
53
 
55
54
  | 助手 | 建议 `--ai` |
56
55
  |------|-------------|
package/dist/index.js CHANGED
@@ -1939,11 +1939,11 @@ var require_semver2 = __commonJS({
1939
1939
  import { Command, Option } from "commander";
1940
1940
 
1941
1941
  // src/config/defaults.ts
1942
- var BUILD_ENV = "test";
1943
- var DEFAULT_API_BASE = "https://api-ci.siluzan.com";
1944
- var DEFAULT_CSO_BASE = "https://cso-ci.siluzan.com";
1945
- var DEFAULT_WEB_BASE = "https://www-ci.siluzan.com";
1946
- var DEFAULT_AGENT_BASE = "https://agent-ci.mysiluzan.com";
1942
+ var BUILD_ENV = "production";
1943
+ var DEFAULT_API_BASE = "https://api.siluzan.com";
1944
+ var DEFAULT_CSO_BASE = "https://cso.siluzan.com";
1945
+ var DEFAULT_WEB_BASE = "https://www.siluzan.com";
1946
+ var DEFAULT_AGENT_BASE = "https://agent.mysiluzan.com";
1947
1947
 
1948
1948
  // src/commands/init.ts
1949
1949
  import * as fs2 from "fs/promises";
@@ -2539,10 +2539,16 @@ function readConfigRaw() {
2539
2539
  return {};
2540
2540
  }
2541
2541
  }
2542
- function writeConfigRaw(data) {
2542
+ function mergeWriteConfig(updates) {
2543
2543
  try {
2544
2544
  fs4.mkdirSync(path4.dirname(CONFIG_FILE2), { recursive: true });
2545
- fs4.writeFileSync(CONFIG_FILE2, JSON.stringify(data, null, 2), "utf8");
2545
+ let existing = {};
2546
+ try {
2547
+ existing = JSON.parse(fs4.readFileSync(CONFIG_FILE2, "utf8"));
2548
+ } catch {
2549
+ }
2550
+ Object.assign(existing, updates);
2551
+ fs4.writeFileSync(CONFIG_FILE2, JSON.stringify(existing, null, 2), "utf8");
2546
2552
  if (process.platform !== "win32") {
2547
2553
  fs4.chmodSync(CONFIG_FILE2, 384);
2548
2554
  }
@@ -2572,8 +2578,7 @@ async function notifyIfOutdated() {
2572
2578
  fetchVersionByTag(tag, latestCacheKey, cfg),
2573
2579
  fetchVersionByTag(minTag, minCacheKey, cfg)
2574
2580
  ]);
2575
- writeConfigRaw({
2576
- ...cfg,
2581
+ mergeWriteConfig({
2577
2582
  _csoLastVersionCheck: (/* @__PURE__ */ new Date()).toISOString(),
2578
2583
  [latestCacheKey]: latest ?? "",
2579
2584
  [minCacheKey]: minRequired ?? ""
@@ -2582,7 +2587,7 @@ async function notifyIfOutdated() {
2582
2587
  if (Date.now() - lastNotified < 24 * 60 * 60 * 1e3) return;
2583
2588
  const tagLabel = isBeta ? "\uFF08\u6D4B\u8BD5\u7248\uFF09" : "\uFF08\u6B63\u5F0F\u7248\uFF09";
2584
2589
  if (minRequired && isNewer(current, minRequired)) {
2585
- writeConfigRaw({ ...cfg, _csoLastNotified: (/* @__PURE__ */ new Date()).toISOString() });
2590
+ mergeWriteConfig({ _csoLastNotified: (/* @__PURE__ */ new Date()).toISOString() });
2586
2591
  console.log(
2587
2592
  `
2588
2593
  [SILUZAN_FORCE_UPDATE] \u5F53\u524D\u7248\u672C ${current} \u5DF2\u8FC7\u671F\uFF0C\u6700\u4F4E\u8981\u6C42\u7248\u672C ${minRequired}${tagLabel}
@@ -2593,7 +2598,7 @@ async function notifyIfOutdated() {
2593
2598
  return;
2594
2599
  }
2595
2600
  if (latest && isNewer(current, latest)) {
2596
- writeConfigRaw({ ...cfg, _csoLastNotified: (/* @__PURE__ */ new Date()).toISOString() });
2601
+ mergeWriteConfig({ _csoLastNotified: (/* @__PURE__ */ new Date()).toISOString() });
2597
2602
  console.log(
2598
2603
  `
2599
2604
  [SILUZAN_UPDATE_AVAILABLE] \u53D1\u73B0\u65B0\u7248\u672C ${latest}${tagLabel}\uFF08\u5F53\u524D ${current}\uFF09
@@ -10,8 +10,14 @@ compatibility: Requires siluzan-cso-cli installed and authenticated via `siluzan
10
10
 
11
11
  如果 CLI 尚未安装,直接帮用户执行对应平台的安装脚本:
12
12
 
13
- - **macOS / Linux / WSL:** `bash scripts/install.sh`
14
- - **Windows PowerShell:** `powershell -ExecutionPolicy Bypass -File scripts/install.ps1`
13
+ - **macOS / Linux / WSL:**
14
+ ```bash
15
+ bash <(curl -fsSL https://unpkg.com/siluzan-cso-cli@latest/dist/skill/scripts/install.sh)
16
+ ```
17
+ - **Windows PowerShell:**
18
+ ```powershell
19
+ irm https://unpkg.com/siluzan-cso-cli@latest/dist/skill/scripts/install.ps1 | iex
20
+ ```
15
21
 
16
22
  脚本会自动完成 Node.js 检测/安装、CLI 安装、Skill 全局注册,并引导用户配置 API Key。无需选择,本脚本专为 siluzan-cso-cli 定制。
17
23
 
@@ -202,6 +208,6 @@ siluzan-cso rag query -q "产品卖点故事" --tags "产品资产库"
202
208
 
203
209
  > 无对应 CLI 命令的模块,或需要引导用户在网页端查看数据时,查阅 `references/web-pages.md` 获取完整页面清单与链接。
204
210
 
205
- URL 格式:`https://www-ci.siluzan.com/v3/foreign_trade/cso/{页面}`
211
+ URL 格式:`https://www.siluzan.com/v3/foreign_trade/cso/{页面}`
206
212
 
207
213
  常用页面:`task`(任务管理)· `postVideo`(发布页)· `ManageAccounts`(账号管理)· `planning`(AI 内容规划)· `table`(绩效报表)· `Workdata`(作品数据)
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "slug": "siluzan-cso",
3
- "version": "1.1.12-beta.1",
4
- "publishedAt": 1776333768936,
3
+ "version": "1.1.12",
4
+ "publishedAt": 1776410351462,
5
5
  "homepage": "https://www.siluzan.com",
6
6
  "source": "https://dev.azure.com/jack4it/Sammamish/_git/siluzan-skill",
7
7
  "requiredBinaries": [
@@ -199,7 +199,7 @@ siluzan-cso publish -c publish-config.json
199
199
 
200
200
  > 查询发布状态、处理失败项 → 参见 `references/task.md`
201
201
 
202
- 前往 CSO 任务管理页面查看进度:`https://www-ci.siluzan.com/v3/foreign_trade/cso/task`
202
+ 前往 CSO 任务管理页面查看进度:`https://www.siluzan.com/v3/foreign_trade/cso/task`
203
203
 
204
204
  ---
205
205
 
@@ -3,7 +3,7 @@
3
3
  ## 安装 CLI
4
4
 
5
5
  ```bash
6
- npm install -g siluzan-cso-cli@beta
6
+ npm install -g siluzan-cso-cli
7
7
  ```
8
8
 
9
9
  环境要求:Node.js 18+
@@ -44,7 +44,7 @@ siluzan-cso config set --token <Token> # 备用:设置 JWT Token
44
44
 
45
45
  > **⚠️ 不要使用 `config set --token <token>` 的方式。** 该方式会将 Token 明文写入 shell history(`~/.bash_history`、`~/.zsh_history`、PowerShell 历史),存在凭证泄露风险。推荐使用 `siluzan-cso login` 交互式输入。
46
46
 
47
- API Key 获取入口:`https://cso-ci.siluzan.com/v3/foreign_trade/settings/apiKeyManagement`
47
+ API Key 获取入口:`https://cso.siluzan.com/v3/foreign_trade/settings/apiKeyManagement`
48
48
 
49
49
  ### 通过环境变量传入凭据(CI/CD 推荐)
50
50
 
@@ -79,8 +79,8 @@ siluzan-cso config show
79
79
  输出示例:
80
80
  ```
81
81
  构建环境 : production
82
- apiBaseUrl : https://api-ci.siluzan.com
83
- csoBaseUrl : https://cso-ci.siluzan.com
82
+ apiBaseUrl : https://api.siluzan.com
83
+ csoBaseUrl : https://cso.siluzan.com
84
84
  apiKey : abcd****1234
85
85
  ```
86
86
 
@@ -1,7 +1,7 @@
1
1
  # web-pages — CSO 后台页面速查
2
2
 
3
3
  > 当需要引导用户前往网页端查看数据或执行操作时,使用本文件中的页面链接。
4
- > URL 格式:`https://www-ci.siluzan.com/v3/foreign_trade/cso/{页面路径}`
4
+ > URL 格式:`https://www.siluzan.com/v3/foreign_trade/cso/{页面路径}`
5
5
 
6
6
  ---
7
7
 
@@ -11,9 +11,9 @@
11
11
 
12
12
  | 页面 | 完整链接 | 功能说明 |
13
13
  |------|----------|----------|
14
- | 账号管理 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/ManageAccounts` | 绑定/授权/查看媒体账号列表、账号状态、Token 到期时间 |
15
- | 账号分组 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/AccountGroup` | 新建分组、管理分组内账号 |
16
- | 重点账号 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/KeyAccounts` | 配置重点关注账号、数据备份 |
14
+ | 账号管理 | `https://www.siluzan.com/v3/foreign_trade/cso/ManageAccounts` | 绑定/授权/查看媒体账号列表、账号状态、Token 到期时间 |
15
+ | 账号分组 | `https://www.siluzan.com/v3/foreign_trade/cso/AccountGroup` | 新建分组、管理分组内账号 |
16
+ | 重点账号 | `https://www.siluzan.com/v3/foreign_trade/cso/KeyAccounts` | 配置重点关注账号、数据备份 |
17
17
 
18
18
 
19
19
  ---
@@ -22,10 +22,10 @@
22
22
 
23
23
  | 页面 | 完整链接 | 功能说明 |
24
24
  |------|----------|----------|
25
- | 发布作品 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/postVideo?contentType=1` | 矩阵发布视频、图文、草稿管理、话题组 contentType=1 是视频,contentType=2是图文 |
25
+ | 发布作品 | `https://www.siluzan.com/v3/foreign_trade/cso/postVideo?contentType=1` | 矩阵发布视频、图文、草稿管理、话题组 contentType=1 是视频,contentType=2是图文 |
26
26
 
27
- | 发布日历 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/publishCalendar` | 日历视图规划发布任务、创建/编辑发布任务 |
28
- | 营销日历 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/marketingCalendar` | 营销节点日历、跳转创建发布任务 |
27
+ | 发布日历 | `https://www.siluzan.com/v3/foreign_trade/cso/publishCalendar` | 日历视图规划发布任务、创建/编辑发布任务 |
28
+ | 营销日历 | `https://www.siluzan.com/v3/foreign_trade/cso/marketingCalendar` | 营销节点日历、跳转创建发布任务 |
29
29
 
30
30
  ---
31
31
 
@@ -33,10 +33,10 @@
33
33
 
34
34
  | 页面 | 完整链接 | 功能说明 |
35
35
  |------|----------|----------|
36
- | 任务列表 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/task` | 发布任务列表、状态筛选、任务详情抽屉 |
37
- | 视频管理 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/VideoMgr` | 已发布视频/图文列表、删除、重发、评论查看 |
38
- | 视频搬家 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/relocation` | 将视频搬运到其他平台 |
39
- | 搬家记录 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/MovingRecord` | 搬家任务列表与执行状态 |
36
+ | 任务列表 | `https://www.siluzan.com/v3/foreign_trade/cso/task` | 发布任务列表、状态筛选、任务详情抽屉 |
37
+ | 视频管理 | `https://www.siluzan.com/v3/foreign_trade/cso/VideoMgr` | 已发布视频/图文列表、删除、重发、评论查看 |
38
+ | 视频搬家 | `https://www.siluzan.com/v3/foreign_trade/cso/relocation` | 将视频搬运到其他平台 |
39
+ | 搬家记录 | `https://www.siluzan.com/v3/foreign_trade/cso/MovingRecord` | 搬家任务列表与执行状态 |
40
40
 
41
41
  ---
42
42
 
@@ -44,9 +44,9 @@
44
44
 
45
45
  | 页面 | 完整链接 | 功能说明 |
46
46
  |------|----------|----------|
47
- | 私信管理 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/letter` | 按渠道/时间查看与处理私信(多平台 Tab) |
48
- | 评论管理 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/comment` | 收到的评论列表、回复、账号组筛选 |
49
- | 智能互动 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/interaction` | 私信欢迎语、自动回复规则配置 |
47
+ | 私信管理 | `https://www.siluzan.com/v3/foreign_trade/cso/letter` | 按渠道/时间查看与处理私信(多平台 Tab) |
48
+ | 评论管理 | `https://www.siluzan.com/v3/foreign_trade/cso/comment` | 收到的评论列表、回复、账号组筛选 |
49
+ | 智能互动 | `https://www.siluzan.com/v3/foreign_trade/cso/interaction` | 私信欢迎语、自动回复规则配置 |
50
50
 
51
51
  ---
52
52
 
@@ -54,9 +54,9 @@
54
54
 
55
55
  | 页面 | 完整链接 | 功能说明 |
56
56
  |------|----------|----------|
57
- | 作品数据 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/Workdata` | 作品维度统计、图表、明细(对应 CLI `report fetch`) |
58
- | 账户数据 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/accountdata` | 账户维度汇总数据、趋势图表 |
59
- | 绩效报表 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/table` | 多维度绩效报表、PDF 导出(对应 CLI `report fetch/records/download`) |
57
+ | 作品数据 | `https://www.siluzan.com/v3/foreign_trade/cso/Workdata` | 作品维度统计、图表、明细(对应 CLI `report fetch`) |
58
+ | 账户数据 | `https://www.siluzan.com/v3/foreign_trade/cso/accountdata` | 账户维度汇总数据、趋势图表 |
59
+ | 绩效报表 | `https://www.siluzan.com/v3/foreign_trade/cso/table` | 多维度绩效报表、PDF 导出(对应 CLI `report fetch/records/download`) |
60
60
 
61
61
  ---
62
62
 
@@ -64,10 +64,10 @@
64
64
 
65
65
  | 页面 | 完整链接 | 功能说明 |
66
66
  |------|----------|----------|
67
- | 内容规划 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/planning` | AI 内容规划列表、生成规划、企业维度筛选(对应 CLI `planning`) |
68
- | 营销首页 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/ContentHome` | 工作台总览:账号数、视频数、最新评论与视频 |
67
+ | 内容规划 | `https://www.siluzan.com/v3/foreign_trade/cso/planning` | AI 内容规划列表、生成规划、企业维度筛选(对应 CLI `planning`) |
68
+ | 营销首页 | `https://www.siluzan.com/v3/foreign_trade/cso/ContentHome` | 工作台总览:账号数、视频数、最新评论与视频 |
69
69
 
70
- | 话题组 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/TopicGroup` | 话题组维护、话题内容管理 |
70
+ | 话题组 | `https://www.siluzan.com/v3/foreign_trade/cso/TopicGroup` | 话题组维护、话题内容管理 |
71
71
 
72
72
 
73
73
  ---
@@ -0,0 +1,167 @@
1
+ #Requires -Version 5.1
2
+ # =============================================================================
3
+ # siluzan-cso-cli - One-click install script (PowerShell)
4
+ # Supported: Windows 10/11 (PowerShell 5.1+ or PowerShell 7+)
5
+ # =============================================================================
6
+
7
+ $ErrorActionPreference = 'Stop'
8
+
9
+ # -- Package info (injected at build time) ------------------------------------
10
+ $PKG_NAME = 'siluzan-cso-cli'
11
+ $CLI_BIN = 'siluzan-cso'
12
+ $SKILL_LABEL = 'Siluzan CSO'
13
+ $INSTALL_CMD = 'npm install -g siluzan-cso-cli'
14
+ $WEB_BASE = 'https://www.siluzan.com'
15
+
16
+ # -- Constants ----------------------------------------------------------------
17
+ $NODE_MAJOR_MIN = 18
18
+ $NPM_MIRROR = 'https://registry.npmmirror.com'
19
+
20
+ # -- Helpers ------------------------------------------------------------------
21
+ function Write-Info { param([string]$Msg) Write-Host "[OK] $Msg" -ForegroundColor Green }
22
+ function Write-Warn { param([string]$Msg) Write-Host "[!] $Msg" -ForegroundColor Yellow }
23
+ function Write-Err { param([string]$Msg) Write-Host "[X] $Msg" -ForegroundColor Red }
24
+ function Write-Step { param([string]$Msg) Write-Host "`n-- $Msg --" -ForegroundColor White }
25
+
26
+ function Refresh-Path {
27
+ $machinePath = [Environment]::GetEnvironmentVariable('Path', 'Machine')
28
+ $userPath = [Environment]::GetEnvironmentVariable('Path', 'User')
29
+ $env:Path = "$machinePath;$userPath"
30
+ }
31
+
32
+ # -- Node.js ------------------------------------------------------------------
33
+ function Test-NodeVersion {
34
+ try {
35
+ $nodeCmd = Get-Command node -ErrorAction SilentlyContinue
36
+ if (-not $nodeCmd) { return $false }
37
+ $ver = (node -v) -replace '^v', ''
38
+ $major = [int]($ver.Split('.')[0])
39
+ return $major -ge $NODE_MAJOR_MIN
40
+ } catch {
41
+ return $false
42
+ }
43
+ }
44
+
45
+ function Get-NodeVersionString {
46
+ try { return (node -v) } catch { return 'N/A' }
47
+ }
48
+
49
+ function Install-NodeJS {
50
+ $hasWinget = $null -ne (Get-Command winget -ErrorAction SilentlyContinue)
51
+ if ($hasWinget) {
52
+ Write-Info 'Installing Node.js LTS via winget...'
53
+ winget install -e --id OpenJS.NodeJS.LTS --silent --accept-package-agreements --accept-source-agreements
54
+ if ($LASTEXITCODE -ne 0) {
55
+ Write-Warn 'winget returned non-zero, trying fallback...'
56
+ Install-NodeFallback
57
+ return
58
+ }
59
+ } else {
60
+ Install-NodeFallback
61
+ return
62
+ }
63
+ Refresh-Path
64
+ if (-not (Test-NodeVersion)) {
65
+ Write-Warn 'Node.js not found after PATH refresh, locating install dir...'
66
+ $nodePath = "$env:ProgramFiles\nodejs"
67
+ if (Test-Path "$nodePath\node.exe") {
68
+ $env:Path = "$nodePath;$env:Path"
69
+ }
70
+ }
71
+ }
72
+
73
+ function Install-NodeFallback {
74
+ Write-Err 'Cannot auto-install Node.js'
75
+ Write-Host ''
76
+ Write-Host ' Please install Node.js manually:' -ForegroundColor Cyan
77
+ Write-Host ' https://nodejs.org/en/download/'
78
+ Write-Host ''
79
+ Write-Host ' After installation, reopen PowerShell and run this script again.'
80
+ throw 'Node.js is required'
81
+ }
82
+
83
+ # -- Main ---------------------------------------------------------------------
84
+ function Main {
85
+ Write-Host ''
86
+ Write-Host '+---------------------------------------------+' -ForegroundColor White
87
+ Write-Host "| $SKILL_LABEL -- Install |" -ForegroundColor White
88
+ Write-Host '+---------------------------------------------+' -ForegroundColor White
89
+ Write-Host ''
90
+
91
+ # Step 1: Environment check
92
+ Write-Step 'Step 1/4: Environment check'
93
+
94
+ if (Test-NodeVersion) {
95
+ Write-Info "Node.js $(Get-NodeVersionString) found"
96
+ } else {
97
+ $nodeCmd = Get-Command node -ErrorAction SilentlyContinue
98
+ if ($nodeCmd) {
99
+ Write-Warn "Node.js $(Get-NodeVersionString) is too old (need >= $NODE_MAJOR_MIN), upgrading..."
100
+ } else {
101
+ Write-Warn 'Node.js not found, installing...'
102
+ }
103
+ Install-NodeJS
104
+ if (-not (Test-NodeVersion)) {
105
+ Write-Err 'Node.js installation failed. Please install manually: https://nodejs.org/'
106
+ return
107
+ }
108
+ Write-Info "Node.js $(Get-NodeVersionString) installed"
109
+ }
110
+
111
+ $npmCmd = Get-Command npm -ErrorAction SilentlyContinue
112
+ if (-not $npmCmd) {
113
+ Refresh-Path
114
+ $npmCmd = Get-Command npm -ErrorAction SilentlyContinue
115
+ }
116
+ if (-not $npmCmd) {
117
+ Write-Err 'npm not found (Node.js installation may be incomplete)'
118
+ return
119
+ }
120
+ Write-Info 'npm ready'
121
+
122
+ $currentRegistry = ''
123
+ try { $currentRegistry = (npm config get registry 2>$null).Trim() } catch {}
124
+ if ($currentRegistry -ne $NPM_MIRROR -and $currentRegistry -ne "$NPM_MIRROR/") {
125
+ Write-Info 'Switching npm registry to China mirror for faster downloads...'
126
+ npm config set registry $NPM_MIRROR
127
+ Write-Info "npm registry set to $NPM_MIRROR"
128
+ } else {
129
+ Write-Info 'npm registry already set to China mirror'
130
+ }
131
+
132
+ # Step 2: Install CLI
133
+ Write-Step "Step 2/4: Install $PKG_NAME"
134
+
135
+ Write-Info "Running: $INSTALL_CMD"
136
+ $installParts = $INSTALL_CMD -split ' '
137
+ $installArgs = $installParts[1..($installParts.Length - 1)]
138
+ & $installParts[0] @installArgs
139
+ if ($LASTEXITCODE -ne 0) { Write-Err "$INSTALL_CMD failed"; return }
140
+ Write-Info "$PKG_NAME installed"
141
+
142
+ Write-Info 'Registering Skill to all AI platform global directories...'
143
+ & $CLI_BIN init --global --force
144
+
145
+ # Step 3: Configure API Key
146
+ Write-Step 'Step 3/4: Configure API Key'
147
+ Write-Host ''
148
+ & $CLI_BIN login
149
+
150
+ # Step 4: Done
151
+ Write-Step 'Step 4/4: Complete'
152
+ Write-Host ''
153
+ Write-Host " $SKILL_LABEL installed successfully!" -ForegroundColor Green
154
+ Write-Host ''
155
+ Write-Host ' Skill registered to these global directories (all AI assistants):'
156
+ Write-Host ' ~/.cursor/skills/ ~/.claude/skills/ ~/.agents/skills/' -ForegroundColor DarkGray
157
+ Write-Host ' ~/.gemini/skills/ ~/.codex/skills/ ~/.kilo/skills/' -ForegroundColor DarkGray
158
+ Write-Host ' ~/.codeium/windsurf/skills/ ~/.config/opencode/skills/' -ForegroundColor DarkGray
159
+ Write-Host ' ~/.openclaw/skills/ ~/.workbuddy/skills/' -ForegroundColor DarkGray
160
+ Write-Host ''
161
+ Write-Host " Update CLI & Skill files: $CLI_BIN update"
162
+ Write-Host ''
163
+ Write-Info "Need help? Visit $WEB_BASE"
164
+ Write-Host ''
165
+ }
166
+
167
+ Main
@@ -0,0 +1,173 @@
1
+ #!/usr/bin/env bash
2
+ # =============================================================================
3
+ # siluzan-cso-cli - One-click install script
4
+ # Supported: macOS, Linux, Windows (WSL)
5
+ # =============================================================================
6
+
7
+ set -euo pipefail
8
+
9
+ # -- Package info (injected at build time) ------------------------------------
10
+ readonly PKG_NAME="siluzan-cso-cli"
11
+ readonly CLI_BIN="siluzan-cso"
12
+ readonly SKILL_LABEL="Siluzan CSO"
13
+ readonly INSTALL_CMD="npm install -g siluzan-cso-cli"
14
+ readonly WEB_BASE="https://www.siluzan.com"
15
+
16
+ # -- Constants ----------------------------------------------------------------
17
+ readonly NODE_MAJOR_MIN=18
18
+ readonly NPM_MIRROR="https://registry.npmmirror.com"
19
+
20
+ RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'
21
+ BOLD='\033[1m'; DIM='\033[2m'; NC='\033[0m'
22
+
23
+ info() { printf "${GREEN}[OK]${NC} %s\n" "$1"; }
24
+ warn() { printf "${YELLOW}[!]${NC} %s\n" "$1"; }
25
+ error() { printf "${RED}[X]${NC} %s\n" "$1" >&2; }
26
+ step() { printf "\n${BOLD}-- %s --${NC}\n" "$1"; }
27
+
28
+ # -- Detect OS ----------------------------------------------------------------
29
+ detect_os() {
30
+ local uname_out
31
+ uname_out=$(uname -s 2>/dev/null || echo "Unknown")
32
+ case "$uname_out" in
33
+ Darwin*) echo "macos" ;;
34
+ Linux*) echo "linux" ;;
35
+ MINGW*|MSYS*|CYGWIN*) echo "gitbash" ;;
36
+ *) echo "unknown" ;;
37
+ esac
38
+ }
39
+
40
+ # -- Node.js ------------------------------------------------------------------
41
+ node_version_ok() {
42
+ command -v node >/dev/null 2>&1 || return 1
43
+ local major
44
+ major=$(node -v | tr -d 'v' | cut -d. -f1)
45
+ [ "$major" -ge "$NODE_MAJOR_MIN" ]
46
+ }
47
+
48
+ install_node() {
49
+ local os_type
50
+ os_type=$(detect_os)
51
+ case "$os_type" in
52
+ macos)
53
+ if command -v brew >/dev/null 2>&1; then
54
+ info "Installing Node.js LTS via Homebrew..."
55
+ brew install node@22
56
+ brew link --overwrite node@22 2>/dev/null || true
57
+ else
58
+ info "Installing Node.js LTS via install-node.vercel.app..."
59
+ curl -fsSL https://install-node.vercel.app/lts | bash -s -- --yes
60
+ fi
61
+ ;;
62
+ linux)
63
+ if command -v apt-get >/dev/null 2>&1; then
64
+ info "Installing Node.js 22.x via NodeSource (apt)..."
65
+ curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
66
+ sudo apt-get install -y nodejs
67
+ elif command -v yum >/dev/null 2>&1; then
68
+ info "Installing Node.js 22.x via NodeSource (yum)..."
69
+ curl -fsSL https://rpm.nodesource.com/setup_22.x | sudo -E bash -
70
+ sudo yum install -y nodejs
71
+ else
72
+ info "Installing Node.js LTS via install-node.vercel.app..."
73
+ curl -fsSL https://install-node.vercel.app/lts | bash -s -- --yes
74
+ fi
75
+ ;;
76
+ gitbash)
77
+ error "Cannot auto-install Node.js in Git Bash. Please use the PowerShell script or install manually."
78
+ echo " https://nodejs.org/en/download/"
79
+ exit 1
80
+ ;;
81
+ *)
82
+ error "Unsupported OS. Please install Node.js >= ${NODE_MAJOR_MIN} manually:"
83
+ echo " https://nodejs.org/en/download/"
84
+ exit 1
85
+ ;;
86
+ esac
87
+
88
+ export PATH="$HOME/.local/bin:$HOME/.nodejs/bin:/usr/local/bin:$PATH"
89
+ hash -r 2>/dev/null || true
90
+
91
+ if ! node_version_ok; then
92
+ error "Node.js installation failed. Please install manually:"
93
+ echo " https://nodejs.org/en/download/"
94
+ exit 1
95
+ fi
96
+ }
97
+
98
+ # -- Main ---------------------------------------------------------------------
99
+ main() {
100
+ echo ""
101
+ echo -e "${BOLD}+---------------------------------------------+${NC}"
102
+ echo -e "${BOLD}| ${SKILL_LABEL} -- Install |${NC}"
103
+ echo -e "${BOLD}+---------------------------------------------+${NC}"
104
+ echo ""
105
+
106
+ # Step 1: Environment check
107
+ step "Step 1/4: Environment check"
108
+
109
+ if node_version_ok; then
110
+ info "Node.js $(node -v) found"
111
+ else
112
+ if command -v node >/dev/null 2>&1; then
113
+ warn "Node.js $(node -v) is too old (need >= ${NODE_MAJOR_MIN}), upgrading..."
114
+ else
115
+ warn "Node.js not found, installing..."
116
+ fi
117
+ install_node
118
+ info "Node.js $(node -v) installed"
119
+ fi
120
+
121
+ if command -v pnpm >/dev/null 2>&1; then
122
+ PKG_MANAGER="pnpm"
123
+ elif command -v npm >/dev/null 2>&1; then
124
+ PKG_MANAGER="npm"
125
+ else
126
+ error "npm not found (Node.js installation may be incomplete)"
127
+ exit 1
128
+ fi
129
+ info "$PKG_MANAGER ready"
130
+
131
+ local current_registry
132
+ current_registry=$(npm config get registry 2>/dev/null || echo "")
133
+ if [ "$current_registry" != "$NPM_MIRROR" ] && [ "$current_registry" != "${NPM_MIRROR}/" ]; then
134
+ info "Switching npm registry to China mirror for faster downloads..."
135
+ npm config set registry "$NPM_MIRROR"
136
+ info "npm registry set to $NPM_MIRROR"
137
+ else
138
+ info "npm registry already set to China mirror"
139
+ fi
140
+
141
+ # Step 2: Install CLI
142
+ step "Step 2/4: Install ${PKG_NAME}"
143
+
144
+ info "Running: ${INSTALL_CMD}"
145
+ $PKG_MANAGER install -g ${PKG_NAME}$(echo "${INSTALL_CMD}" | grep -o '@[^ ]*' || true)
146
+ info "${PKG_NAME} installed"
147
+
148
+ info "Registering Skill to all AI platform global directories..."
149
+ ${CLI_BIN} init --global --force
150
+
151
+ # Step 3: Configure API Key
152
+ step "Step 3/4: Configure API Key"
153
+ echo ""
154
+ ${CLI_BIN} login
155
+
156
+ # Step 4: Done
157
+ step "Step 4/4: Complete"
158
+ echo ""
159
+ echo -e " ${GREEN}${SKILL_LABEL} installed successfully!${NC}"
160
+ echo ""
161
+ echo " Skill registered to these global directories (all AI assistants):"
162
+ echo -e " ${DIM}~/.cursor/skills/ ~/.claude/skills/ ~/.agents/skills/"
163
+ echo -e " ~/.gemini/skills/ ~/.codex/skills/ ~/.kilo/skills/"
164
+ echo -e " ~/.codeium/windsurf/skills/ ~/.config/opencode/skills/"
165
+ echo -e " ~/.openclaw/skills/ ~/.workbuddy/skills/${NC}"
166
+ echo ""
167
+ echo " Update CLI & Skill files: ${CLI_BIN} update"
168
+ echo ""
169
+ info "Need help? Visit ${WEB_BASE}"
170
+ echo ""
171
+ }
172
+
173
+ main "$@"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "siluzan-cso-cli",
3
- "version": "1.1.12-beta.1",
3
+ "version": "1.1.12",
4
4
  "description": "Siluzan platform AI Skill CLI — multi-platform content publishing (video/image-text) for Cursor, Claude Code, and OpenClaw.",
5
5
  "type": "module",
6
6
  "bin": {