@simonyea/holysheep-cli 1.3.0 → 1.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simonyea/holysheep-cli",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "一键配置所有 AI 编程工具接入 HolySheep API — Claude Code / Codex / Gemini CLI / OpenCode / OpenClaw / Aider / Cursor",
5
5
  "keywords": [
6
6
  "claude",
@@ -84,10 +84,10 @@ module.exports = {
84
84
 
85
85
  console.log(chalk.gray('\n ⚙️ 正在通过 OpenClaw 官方向导配置(约 30 秒)...'))
86
86
 
87
- // Step 1: 如果配置文件存在且有问题,先 doctor --fix
88
- if (fs.existsSync(CONFIG_FILE)) {
89
- run(['doctor', '--fix'], { stdio: 'ignore', timeout: 15000 })
90
- }
87
+ // Step 1: 删除旧配置,避免 onboard 检测到现有配置后跳过重写
88
+ try {
89
+ if (fs.existsSync(CONFIG_FILE)) fs.unlinkSync(CONFIG_FILE)
90
+ } catch {}
91
91
 
92
92
  // Step 2: 用官方 onboard 非交互式命令完成配置 + 安装系统服务
93
93
  const r = run([
@@ -161,9 +161,7 @@ function _startGateway() {
161
161
  const chalk = require('chalk')
162
162
  const isWin = process.platform === 'win32'
163
163
 
164
- // install,再 start
165
- run(['gateway', 'install'], { stdio: 'ignore', timeout: 20000 })
166
-
164
+ // 先尝试 gateway start(已有服务时生效)
167
165
  const r = run(['gateway', 'start'], { timeout: 10000 })
168
166
  if (r.status === 0) {
169
167
  console.log(chalk.green(' ✓ OpenClaw Gateway 已启动'))
@@ -171,24 +169,26 @@ function _startGateway() {
171
169
  return true
172
170
  }
173
171
 
174
- // fallback: 直接运行 gateway 进程(Windows Start-Process 后台)
172
+ // gateway start 失败 直接后台运行进程(不依赖 schtasks/daemon)
173
+ const { spawn } = require('child_process')
175
174
  if (isWin) {
175
+ // Windows: Start-Process 开隐藏窗口运行 npx openclaw gateway
176
176
  spawnSync('powershell', [
177
177
  '-NonInteractive', '-Command',
178
- `Start-Process -FilePath "npx" -ArgumentList @("openclaw","gateway","--port","18789") -WindowStyle Hidden`
179
- ], { shell: false, timeout: 5000, stdio: 'ignore' })
178
+ `Start-Process powershell -ArgumentList '-NonInteractive','-WindowStyle','Hidden','-Command','npx openclaw gateway --port 18789' -WindowStyle Hidden`
179
+ ], { shell: false, timeout: 8000, stdio: 'ignore' })
180
180
  } else {
181
- const { spawn } = require('child_process')
182
181
  const child = spawn('openclaw', ['gateway', '--port', '18789'], {
183
182
  detached: true, stdio: 'ignore',
184
183
  })
185
184
  child.unref()
186
185
  }
187
186
 
188
- // 等 5 秒,验证是否真的起来
187
+ // 等 5 秒让 gateway 起来
189
188
  const deadline = Date.now() + 5000
190
189
  while (Date.now() < deadline) {}
191
190
 
191
+ // 验证
192
192
  try {
193
193
  const { execSync } = require('child_process')
194
194
  execSync(