@simonyea/holysheep-cli 1.7.22 → 1.7.23

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.22",
3
+ "version": "1.7.23",
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",
@@ -56,11 +56,22 @@ function getWindowsImmediateLaunchCmd(tool) {
56
56
  return null
57
57
  }
58
58
 
59
- function getPreferredCliPrefix() {
60
- if (process.platform === 'win32') {
61
- return 'hs'
59
+ // 检测当前 shell 里的 hs 命令是否已包含 claude 子命令
60
+ function isHsClaudeAvailable() {
61
+ try {
62
+ const out = execSync('hs --help', {
63
+ encoding: 'utf8',
64
+ timeout: 4000,
65
+ shell: process.platform === 'win32',
66
+ stdio: ['ignore', 'pipe', 'ignore'],
67
+ })
68
+ return out.includes('claude')
69
+ } catch {
70
+ return false
62
71
  }
72
+ }
63
73
 
74
+ function getPreferredCliPrefix() {
64
75
  const mainEntry = String(require.main?.filename || '')
65
76
  const runningFromNpxCache =
66
77
  /[\\/]_npx[\\/]/i.test(mainEntry) ||
@@ -394,6 +405,11 @@ async function setup(options) {
394
405
  const immediateCmd = getWindowsImmediateLaunchCmd({ ...r.tool, launchCmd: preferredLaunchCmd || r.tool.launchCmd })
395
406
  console.log(` ${chalk.gray('▶ 立即启动:')} ${chalk.cyan.bold(immediateCmd || preferredLaunchCmd || r.tool.launchCmd)}`)
396
407
  console.log(` ${chalk.gray('▶ 新开终端后:')} ${chalk.cyan.bold(preferredLaunchCmd || r.tool.launchCmd)}`)
408
+ } else if (r.tool.id === 'claude-code' && !isHsClaudeAvailable()) {
409
+ // hs claude 在当前 shell 不可用(hs 未安装或版本过旧),显示两条命令
410
+ const npxCmd = `npx @simonyea/holysheep-cli@${pkg.version} claude`
411
+ console.log(` ${chalk.gray('▶ 立即启动:')} ${chalk.cyan.bold(npxCmd)}`)
412
+ console.log(` ${chalk.gray('▶ 新开终端后:')} ${chalk.cyan.bold('hs claude')}`)
397
413
  } else {
398
414
  console.log(` ${chalk.gray('▶ 启动命令:')} ${chalk.cyan.bold(preferredLaunchCmd || r.tool.launchCmd)}`)
399
415
  }