@ziniao-open/cli 0.1.0-beta.39 → 0.1.0-beta.50
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 +5 -15
- package/package.json +1 -1
- package/scripts/install.js +17 -3
package/README.md
CHANGED
|
@@ -6,24 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
## 安装
|
|
8
8
|
|
|
9
|
-
### npm(推荐,需 Node.js ≥ 18)
|
|
10
|
-
|
|
11
9
|
```bash
|
|
12
10
|
npm install -g @ziniao-open/cli
|
|
13
11
|
```
|
|
14
12
|
|
|
15
13
|
安装时会自动下载当前平台对应的预编译二进制(支持 macOS / Linux / Windows × amd64 / arm64),并做 SHA-256 校验。
|
|
16
14
|
|
|
17
|
-
### 直接下载二进制(无 Node 环境)
|
|
18
|
-
|
|
19
|
-
从发布地址下载对应平台的压缩包,解压后把 `ziniao-cli` 放入 `PATH`。
|
|
20
|
-
|
|
21
|
-
### 安装测试版
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
npm install -g @ziniao-open/cli@beta
|
|
25
|
-
```
|
|
26
|
-
|
|
27
15
|
## 快速开始
|
|
28
16
|
|
|
29
17
|
```bash
|
|
@@ -60,10 +48,12 @@ ziniao-cli --help
|
|
|
60
48
|
|
|
61
49
|
## AI Agent Skills
|
|
62
50
|
|
|
63
|
-
仓库提供 13 个开箱即用的
|
|
51
|
+
仓库提供 13 个开箱即用的 AI Agent Skill,包括员工、店铺、角色、部门、设备、访问策略管理,以及批量授权、店铺巡检等编排工作流。
|
|
64
52
|
|
|
65
|
-
|
|
53
|
+
安装 Skill:
|
|
66
54
|
|
|
67
55
|
```bash
|
|
68
|
-
npx skills add
|
|
56
|
+
npx skills add ziniao-open/skills -y -g
|
|
69
57
|
```
|
|
58
|
+
|
|
59
|
+
详见 [ziniao-skills](https://github.com/ziniao-open/skills)。
|
package/package.json
CHANGED
package/scripts/install.js
CHANGED
|
@@ -153,11 +153,25 @@ function parseChecksums(text) {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
function extract(archivePath, destDir) {
|
|
156
|
+
if (process.platform === "win32" && archivePath.endsWith(".zip")) {
|
|
157
|
+
const ps = spawnSync("powershell.exe", [
|
|
158
|
+
"-NoProfile", "-NonInteractive", "-Command",
|
|
159
|
+
`Expand-Archive -LiteralPath '${archivePath}' -DestinationPath '${destDir}' -Force`
|
|
160
|
+
], { stdio: "inherit" });
|
|
161
|
+
if (!ps.error && ps.status === 0) return;
|
|
162
|
+
}
|
|
156
163
|
let tarCmd = "tar";
|
|
157
164
|
if (process.platform === "win32") {
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
165
|
+
const sysRoot = process.env.SystemRoot || "C:\\Windows";
|
|
166
|
+
const candidates = [
|
|
167
|
+
join(sysRoot, "Sysnative", "tar.exe"),
|
|
168
|
+
join(sysRoot, "System32", "tar.exe"),
|
|
169
|
+
];
|
|
170
|
+
for (const p of candidates) {
|
|
171
|
+
if (existsSync(p)) {
|
|
172
|
+
tarCmd = p;
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
161
175
|
}
|
|
162
176
|
}
|
|
163
177
|
const res = spawnSync(tarCmd, ["-xf", archivePath, "-C", destDir], { stdio: "inherit" });
|