@simonyea/holysheep-cli 1.2.7 → 1.2.8

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.2.7",
3
+ "version": "1.2.8",
4
4
  "description": "一键配置所有 AI 编程工具接入 HolySheep API — Claude Code / Codex / Gemini CLI / OpenCode / OpenClaw / Aider / Cursor",
5
5
  "keywords": [
6
6
  "claude",
@@ -118,7 +118,15 @@ module.exports = {
118
118
  id: 'openclaw',
119
119
 
120
120
  checkInstalled() {
121
- return require('../utils/which').commandExists('openclaw')
121
+ if (require('../utils/which').commandExists('openclaw')) return true
122
+ // Windows PATH 未刷新时,用 npx 探测
123
+ if (process.platform === 'win32') {
124
+ try {
125
+ require('child_process').execSync('npx openclaw --version', { stdio: 'ignore', timeout: 10000 })
126
+ return true
127
+ } catch {}
128
+ }
129
+ return false
122
130
  },
123
131
 
124
132
  isConfigured() {
@@ -162,7 +170,12 @@ module.exports = {
162
170
  getConfigPath() { return CONFIG_FILE },
163
171
  hint: 'Gateway 已自动在后台启动,打开浏览器即可使用',
164
172
  launchCmd: null,
165
- launchNote: '🌐 打开浏览器访问 http://127.0.0.1:18789/',
173
+ get launchNote() {
174
+ const isWin = process.platform === 'win32'
175
+ return isWin
176
+ ? '🌐 打开浏览器访问 http://127.0.0.1:18789/\n 如无法访问请运行: npx openclaw gateway start'
177
+ : '🌐 打开浏览器访问 http://127.0.0.1:18789/'
178
+ },
166
179
  installCmd: 'npm install -g openclaw@latest',
167
180
  docsUrl: 'https://docs.openclaw.ai',
168
181
  }
@@ -179,7 +192,8 @@ module.exports = {
179
192
  function _initAndStartGateway() {
180
193
  const chalk = require('chalk')
181
194
  const isWin = process.platform === 'win32'
182
- const bin = 'openclaw'
195
+ // Windows 刚装完 npm 包,PATH 未刷新,用 npx 兜底
196
+ const bin = isWin ? 'npx openclaw' : 'openclaw'
183
197
 
184
198
  console.log(chalk.gray('\n ⚙️ 正在启动 OpenClaw Gateway...'))
185
199
 
@@ -212,10 +226,10 @@ function _initAndStartGateway() {
212
226
  // Step 3: fallback — 直接后台运行进程
213
227
  console.log(chalk.gray(' → 以守护进程模式启动...'))
214
228
  if (isWin) {
215
- // Windows: PowerShell Start-Process 后台运行,不弹窗
229
+ // Windows: PowerShell Start-Process 后台运行(用 npx 兜底 PATH 未刷新)
216
230
  spawnSync('powershell', [
217
231
  '-NonInteractive', '-WindowStyle', 'Hidden', '-Command',
218
- `Start-Process -FilePath "openclaw" -ArgumentList "gateway","--port","18789" -WindowStyle Hidden`
232
+ `Start-Process -FilePath "npx" -ArgumentList "openclaw","gateway","--port","18789" -WindowStyle Hidden`
219
233
  ], { shell: false, timeout: 5000, stdio: 'ignore' })
220
234
  } else {
221
235
  const { spawn } = require('child_process')