@zhizhi-ai/cli 0.1.0 → 0.1.1

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 ADDED
@@ -0,0 +1,84 @@
1
+ # @zhizhi-ai/cli
2
+
3
+ Zhizhi 命令行客户端。
4
+
5
+ ## 用法
6
+
7
+ 不全局安装,直接通过 `npx` 运行:
8
+
9
+ ```sh
10
+ npx @zhizhi-ai/cli --help
11
+ ```
12
+
13
+ 也可以全局安装后使用 `zhizhi` 命令:
14
+
15
+ ```sh
16
+ npm install -g @zhizhi-ai/cli
17
+ zhizhi --help
18
+ ```
19
+
20
+ ## 远端机器接入
21
+
22
+ 在远端机器上使用 Web 端生成的 pairing token 注册 runtime connector:
23
+
24
+ ```sh
25
+ npx @zhizhi-ai/cli connect \
26
+ --server https://your-zhizhi-server.example.com \
27
+ --workspace-id <workspace-id> \
28
+ --pairing-token <pairing-token> \
29
+ --name "Remote Computer"
30
+ ```
31
+
32
+ 注册成功后,启动 connector:
33
+
34
+ ```sh
35
+ npx @zhizhi-ai/cli serve
36
+ ```
37
+
38
+ 后台启动 connector,并把日志写入本机 Zhizhi root 下的 daemon 日志文件:
39
+
40
+ ```sh
41
+ npx @zhizhi-ai/cli serve --background
42
+ ```
43
+
44
+ 只执行一轮 heartbeat/claim,用于轻量诊断:
45
+
46
+ ```sh
47
+ npx @zhizhi-ai/cli serve --once
48
+ ```
49
+
50
+ ## 常用命令
51
+
52
+ ```sh
53
+ # 查看本地 connector profile 和 server live status
54
+ npx @zhizhi-ai/cli status
55
+
56
+ # 查看本地 daemon 状态
57
+ npx @zhizhi-ai/cli daemon status
58
+
59
+ # 查看本地 daemon 日志尾部,默认 80 行
60
+ npx @zhizhi-ai/cli daemon logs --tail 120
61
+
62
+ # 停止后台 daemon
63
+ npx @zhizhi-ai/cli daemon stop
64
+
65
+ # revoke connection key 并删除本地 profile
66
+ npx @zhizhi-ai/cli disconnect
67
+
68
+ # 轮换 connection key
69
+ npx @zhizhi-ai/cli rotate-key
70
+
71
+ # 输出 CLI 版本
72
+ npx @zhizhi-ai/cli version
73
+
74
+ # 本地轻量诊断
75
+ npx @zhizhi-ai/cli doctor
76
+ ```
77
+
78
+ ## 本地配置位置
79
+
80
+ 所有命令都支持全局参数 `--root <PATH>` 覆盖本机 Zhizhi root;它的优先级高于 `ZHIZHI_ROOT` 环境变量。
81
+
82
+ ```sh
83
+ npx @zhizhi-ai/cli --root /opt/zhizhi-client status
84
+ ```
package/bin/zhizhi.js CHANGED
@@ -6,7 +6,7 @@ const require = createRequire(import.meta.url);
6
6
 
7
7
  const targets = {
8
8
  "darwin-arm64": "@zhizhi-ai/cli-darwin-arm64",
9
- "linux-x64": "@zhizhi-ai/cli-linux-x64"
9
+ "linux-x64": "@zhizhi-ai/cli-linux-x64-musl"
10
10
  };
11
11
 
12
12
  const targetKey = `${process.platform}-${process.arch}`;
@@ -24,7 +24,7 @@ try {
24
24
  binaryPath = require.resolve(`${packageName}/bin/zhizhi`);
25
25
  } catch {
26
26
  console.error(
27
- `Missing platform package ${packageName}. Reinstall @zhizhi/cli on this machine and try again.`
27
+ `Missing platform package ${packageName}. Reinstall @zhizhi-ai/cli on this machine and try again.`
28
28
  );
29
29
  process.exit(1);
30
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhizhi-ai/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Zhizhi command line client",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -8,11 +8,12 @@
8
8
  "zhizhi": "bin/zhizhi.js"
9
9
  },
10
10
  "files": [
11
- "bin/zhizhi.js"
11
+ "bin/zhizhi.js",
12
+ "README.md"
12
13
  ],
13
14
  "optionalDependencies": {
14
- "@zhizhi-ai/cli-darwin-arm64": "0.1.0",
15
- "@zhizhi-ai/cli-linux-x64": "0.1.0"
15
+ "@zhizhi-ai/cli-darwin-arm64": "0.1.1",
16
+ "@zhizhi-ai/cli-linux-x64-musl": "0.1.1"
16
17
  },
17
18
  "publishConfig": {
18
19
  "access": "public"