ziwei-cli 1.1.0 → 1.1.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/bin/install.cjs +17 -11
- package/package.json +4 -4
package/bin/install.cjs
CHANGED
|
@@ -161,18 +161,23 @@ async function installCli() {
|
|
|
161
161
|
logStep("3/4", "安装 ziwei CLI...");
|
|
162
162
|
|
|
163
163
|
try {
|
|
164
|
-
// Check if already installed
|
|
164
|
+
// Check if already installed with correct version
|
|
165
165
|
try {
|
|
166
|
-
execSync("
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
const version = execSync("ziwei --version", { encoding: "utf8" }).trim();
|
|
167
|
+
const pkg = require(path.join(PACKAGE_ROOT, "package.json"));
|
|
168
|
+
if (version === pkg.version) {
|
|
169
|
+
logSuccess(`ziwei CLI 已安装 (v${version})`);
|
|
170
|
+
return true;
|
|
171
|
+
}
|
|
172
|
+
logInfo(`当前版本 ${version},升级到 ${pkg.version}...`);
|
|
169
173
|
} catch {
|
|
170
174
|
// Not installed, proceed
|
|
171
175
|
}
|
|
172
176
|
|
|
173
|
-
//
|
|
174
|
-
|
|
175
|
-
|
|
177
|
+
// Global install ensures dependencies are properly resolved
|
|
178
|
+
// and persists after npx temp dir is cleaned up
|
|
179
|
+
logInfo("正在全局安装 ziwei CLI 及依赖...");
|
|
180
|
+
execSync("npm install -g ziwei-cli", { stdio: "inherit" });
|
|
176
181
|
logSuccess("ziwei CLI 安装成功");
|
|
177
182
|
|
|
178
183
|
// Verify
|
|
@@ -182,7 +187,7 @@ async function installCli() {
|
|
|
182
187
|
return true;
|
|
183
188
|
} catch (error) {
|
|
184
189
|
logError(`CLI 安装失败: ${error.message}`);
|
|
185
|
-
logInfo("你可以手动运行:
|
|
190
|
+
logInfo("你可以手动运行: npm install -g ziwei-cli");
|
|
186
191
|
return false;
|
|
187
192
|
}
|
|
188
193
|
}
|
|
@@ -197,15 +202,16 @@ ${color("green", "━━━━━━━━━━━━━━━━━━━━
|
|
|
197
202
|
|
|
198
203
|
${color("cyan", "CLI 命令:")}
|
|
199
204
|
ziwei palace --palace 命宫 --date 1990-05-15 --time 10:30 --gender 男 --city 北京
|
|
200
|
-
ziwei
|
|
205
|
+
ziwei bazi --date 1990-05-15 --time 10:30 --gender 男
|
|
206
|
+
ziwei calendar
|
|
201
207
|
|
|
202
208
|
${color("cyan", "Skill 触发词:")}
|
|
203
|
-
|
|
209
|
+
算命、看命、命盘、运势、合盘、紫微、八字、流年、大限
|
|
204
210
|
|
|
205
211
|
${color("yellow", "在 Claude Code / OpenClaw 中试试:")}
|
|
206
212
|
"帮我算命"
|
|
207
213
|
"看看我今年的运势"
|
|
208
|
-
"
|
|
214
|
+
"帮我排个八字"
|
|
209
215
|
|
|
210
216
|
${color("dim", "重启 Claude Code 会话后 skill 将自动加载")}
|
|
211
217
|
`);
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ziwei-cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "紫微斗数 + 八字命理分析 CLI 工具 - Claude Code / OpenClaw Skill",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "bin/ziwei.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"ziwei-cli": "
|
|
9
|
-
"ziwei": "
|
|
8
|
+
"ziwei-cli": "bin/install.cjs",
|
|
9
|
+
"ziwei": "bin/ziwei.js"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"bin/",
|
|
@@ -44,6 +44,6 @@
|
|
|
44
44
|
},
|
|
45
45
|
"repository": {
|
|
46
46
|
"type": "git",
|
|
47
|
-
"url": "https://github.com/shanrichard/ziwei-skill"
|
|
47
|
+
"url": "git+https://github.com/shanrichard/ziwei-skill.git"
|
|
48
48
|
}
|
|
49
49
|
}
|