@ziniao-open/cli 0.1.0-beta.39 → 0.1.0-beta.62

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
@@ -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
@@ -58,12 +46,26 @@ ziniao-cli --help
58
46
 
59
47
  完整列表见 `ziniao-cli --help`。
60
48
 
49
+ ## 开发版打包
50
+
51
+ 在 `dev` 分支使用 `make package-dev` 生成本地多平台 snapshot 包。版本基于最近的发布 tag,并使用本机递增计数器:最近 tag 为 `v1.0.7` 时,依次生成 `1.0.7-dev-1`、`1.0.7-dev-2`、`1.0.7-dev-3`。
52
+
53
+ 计数器保存在 `~/.ziniao-cli/dev-build-counter`;当最近 tag 变化时计数从 `1` 重新开始。可通过 `ZINIAO_CLI_DEV_COUNTER_FILE` 指定其他计数器路径,便于 CI 或测试隔离。产物写入 `dist/`,该命令只打包,不发布。
54
+
55
+ 打包还会用同一版本更新仓库根目录的 `ziniao-cli`。因此已执行 `ziniao-cli-use dev` 后,无须重新切换,下一次运行 `ziniao-cli` 就会使用刚打包的开发版。
56
+
57
+ 开发版内置测试环境 `https://test-sbappstoreapi.ziniao.com` 与 `https://test-open.ziniao.com`,并默认使用独立配置目录 `~/.ziniao-cli-dev/`。正式发布包内置生产环境,使用 `~/.ziniao-cli/`;两者的 API Key 和配置不会互相读取。开发版首次运行时执行 `ziniao-cli config init` 即可配置测试环境。
58
+
61
59
  ## AI Agent Skills
62
60
 
63
- 仓库提供 13 个开箱即用的 Cursor / Claude Skill,包括员工、店铺、角色、部门、设备、访问策略管理,以及批量授权、店铺巡检等编排工作流。
61
+ 仓库提供 13 个开箱即用的 AI Agent Skill,包括员工、店铺、角色、部门、设备、访问策略管理,以及批量授权、店铺巡检等编排工作流。
64
62
 
65
- 安装到本地 Cursor
63
+ 安装 Skill
66
64
 
67
65
  ```bash
68
- npx skills add https://github.com/ziniao-open/ziniao_cli -g
66
+ ziniao-cli skills install
69
67
  ```
68
+
69
+ 备选:`npx skills add ziniao-open/skills -y -g`
70
+
71
+ 详见 [ziniao-skills](https://github.com/ziniao-open/skills)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ziniao-open/cli",
3
- "version": "0.1.0-beta.39",
3
+ "version": "0.1.0-beta.62",
4
4
  "description": "紫鸟开放平台命令行工具,为开发者和 AI Agent 提供统一的接口调用入口。",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {
@@ -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 systemTar = join(process.env.SystemRoot || "C:\\Windows", "System32", "tar.exe");
159
- if (existsSync(systemTar)) {
160
- tarCmd = systemTar;
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" });