@simonyea/holysheep-cli 1.3.8 → 1.3.9

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.8",
3
+ "version": "1.3.9",
4
4
  "description": "一键配置所有 AI 编程工具接入 HolySheep API — Claude Code / Codex / Gemini CLI / OpenCode / OpenClaw / Aider / Cursor",
5
5
  "keywords": [
6
6
  "claude",
@@ -99,19 +99,31 @@ module.exports = {
99
99
  // 2. doctor --fix 修复任何兼容性问题
100
100
  npx('doctor', '--fix')
101
101
 
102
+ // 读取写入的 token(用于生成带 token 的直接访问 URL)
103
+ let savedToken = ''
104
+ try {
105
+ const cfg = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'))
106
+ savedToken = cfg?.gateway?.auth?.token || ''
107
+ } catch {}
108
+
102
109
  // 3. 启动 Gateway
103
110
  console.log(chalk.gray(' → 正在启动 Gateway...'))
104
111
  const ok = _startGateway()
105
112
 
106
113
  if (ok) {
107
114
  console.log(chalk.green(' ✓ OpenClaw Gateway 已启动'))
108
- console.log(chalk.cyan(' → 浏览器打开: http://127.0.0.1:18789/'))
109
115
  } else {
110
- console.log(chalk.yellow(' ⚠️ 请手动启动 Gateway:'))
111
- console.log(chalk.cyan(isWin ? ' npx openclaw gateway' : ' openclaw gateway'))
116
+ console.log(chalk.yellow(' ⚠️ Gateway 正在启动,请稍等几秒...'))
112
117
  }
113
118
 
114
- return { file: CONFIG_FILE, hot: false }
119
+ // 打印带 token 的直接访问 URL(无需手动填 token)
120
+ const dashUrl = savedToken
121
+ ? `http://127.0.0.1:18789/?token=${savedToken}`
122
+ : 'http://127.0.0.1:18789/'
123
+ console.log(chalk.cyan(`\n → 浏览器打开(已含 token,直接可用):`))
124
+ console.log(chalk.bold.cyan(` ${dashUrl}`))
125
+
126
+ return { file: CONFIG_FILE, hot: false, _dashUrl: dashUrl }
115
127
  },
116
128
 
117
129
  reset() {
@@ -122,9 +134,13 @@ module.exports = {
122
134
  hint: 'Gateway 已启动,打开浏览器即可使用',
123
135
  launchCmd: null,
124
136
  get launchNote() {
125
- return isWin
126
- ? '🌐 打开浏览器: http://127.0.0.1:18789/\n 如无法访问: npx openclaw gateway'
127
- : '🌐 打开浏览器: http://127.0.0.1:18789/'
137
+ // 读取 token,生成带 token 的 URL
138
+ try {
139
+ const cfg = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'))
140
+ const token = cfg?.gateway?.auth?.token
141
+ if (token) return `🌐 浏览器打开(含 token): http://127.0.0.1:18789/?token=${token}`
142
+ } catch {}
143
+ return '🌐 打开浏览器: http://127.0.0.1:18789/'
128
144
  },
129
145
  installCmd: 'npm install -g openclaw@latest',
130
146
  docsUrl: 'https://docs.openclaw.ai',