@simonyea/holysheep-cli 1.7.0 → 1.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simonyea/holysheep-cli",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
4
4
  "description": "Claude Code/Cursor/Cline API relay for China — ¥1=$1, WeChat/Alipay payment, no credit card, no VPN. One command setup for all AI coding tools.",
5
5
  "keywords": [
6
6
  "openai-china",
@@ -42,7 +42,7 @@
42
42
  "homepage": "https://holysheep.ai",
43
43
  "repository": {
44
44
  "type": "git",
45
- "url": "git+https://gitee.com/holysheep123/holysheep-cli.git"
45
+ "url": "git+https://gitee.com/simonyea/holysheep-cli.git"
46
46
  },
47
47
  "license": "MIT",
48
48
  "bin": {
@@ -19,6 +19,27 @@ const AUTO_INSTALL = {
19
19
  'aider': { cmd: 'pip install aider-chat', mgr: 'pip' },
20
20
  }
21
21
 
22
+ function getWindowsImmediateLaunchCmd(tool) {
23
+ if (process.platform !== 'win32' || !tool?.launchCmd) return null
24
+
25
+ const cmdBin = tool.launchCmd.split(' ')[0]
26
+
27
+ try {
28
+ const npmPrefix = execSync('npm prefix -g', { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim()
29
+ if (npmPrefix) {
30
+ const directCmd = `${npmPrefix}\\${cmdBin}.cmd`
31
+ return `& "${directCmd}"`
32
+ }
33
+ } catch {}
34
+
35
+ const appData = process.env.APPDATA
36
+ if (appData) {
37
+ return `& "${appData}\\npm\\${cmdBin}.cmd"`
38
+ }
39
+
40
+ return null
41
+ }
42
+
22
43
  function canAutoInstall(toolId) {
23
44
  return !!AUTO_INSTALL[toolId]
24
45
  }
@@ -290,10 +311,9 @@ async function setup(options) {
290
311
  })
291
312
  } else if (r.tool.launchCmd) {
292
313
  if (r.tool._winJustInstalled) {
293
- const cmdBin = r.tool.launchCmd.split(' ')[0]
294
- const cmdArgs = r.tool.launchCmd.split(' ').slice(1).join(' ')
295
- const npxCmd = 'npx ' + cmdBin + (cmdArgs ? ' ' + cmdArgs : '')
296
- console.log(` ${chalk.gray('▶ 启动命令:')} ${chalk.cyan.bold(npxCmd)}`)
314
+ const immediateCmd = getWindowsImmediateLaunchCmd(r.tool)
315
+ console.log(` ${chalk.gray('▶ 立即启动:')} ${chalk.cyan.bold(immediateCmd || r.tool.launchCmd)}`)
316
+ console.log(` ${chalk.gray('▶ 新开终端后:')} ${chalk.cyan.bold(r.tool.launchCmd)}`)
297
317
  } else {
298
318
  console.log(` ${chalk.gray('▶ 启动命令:')} ${chalk.cyan.bold(r.tool.launchCmd)}`)
299
319
  }