@simonyea/holysheep-cli 1.7.2 → 1.7.3
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 +1 -1
- package/src/commands/setup.js +7 -5
- package/src/commands/upgrade.js +17 -3
- package/src/tools/claude-code.js +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simonyea/holysheep-cli",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.3",
|
|
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",
|
package/src/commands/setup.js
CHANGED
|
@@ -11,7 +11,12 @@ const TOOLS = require('../tools')
|
|
|
11
11
|
|
|
12
12
|
// 工具的自动安装命令(npm/pip)
|
|
13
13
|
const AUTO_INSTALL = {
|
|
14
|
-
'claude-code': {
|
|
14
|
+
'claude-code': {
|
|
15
|
+
cmd: process.platform === 'win32'
|
|
16
|
+
? 'powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://claude.ai/install.ps1 | iex"'
|
|
17
|
+
: 'curl -fsSL https://claude.ai/install.sh | bash',
|
|
18
|
+
mgr: process.platform === 'win32' ? 'powershell' : 'bash',
|
|
19
|
+
},
|
|
15
20
|
'codex': { cmd: 'npm install -g @openai/codex', mgr: 'npm' },
|
|
16
21
|
'gemini-cli': { cmd: 'npm install -g @google/gemini-cli', mgr: 'npm' },
|
|
17
22
|
'opencode': { cmd: 'npm install -g opencode-ai', mgr: 'npm' },
|
|
@@ -58,10 +63,7 @@ async function tryAutoInstall(tool) {
|
|
|
58
63
|
|
|
59
64
|
const spinner = ora(`正在安装 ${tool.name}...`).start()
|
|
60
65
|
try {
|
|
61
|
-
const ret = spawnSync(info.cmd
|
|
62
|
-
stdio: 'inherit',
|
|
63
|
-
shell: true,
|
|
64
|
-
})
|
|
66
|
+
const ret = spawnSync(info.cmd, [], { stdio: 'inherit', shell: true })
|
|
65
67
|
if (ret.status !== 0) {
|
|
66
68
|
spinner.fail(`安装失败,请手动运行: ${chalk.cyan(info.cmd)}`)
|
|
67
69
|
return false
|
package/src/commands/upgrade.js
CHANGED
|
@@ -12,8 +12,10 @@ const UPGRADABLE_TOOLS = [
|
|
|
12
12
|
id: 'claude-code',
|
|
13
13
|
command: 'claude',
|
|
14
14
|
versionCmd: 'claude --version',
|
|
15
|
-
npmPkg:
|
|
16
|
-
installCmd:
|
|
15
|
+
npmPkg: null,
|
|
16
|
+
installCmd: process.platform === 'win32'
|
|
17
|
+
? 'powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://claude.ai/install.ps1 | iex"'
|
|
18
|
+
: 'curl -fsSL https://claude.ai/install.sh | bash',
|
|
17
19
|
},
|
|
18
20
|
{
|
|
19
21
|
name: 'Codex CLI',
|
|
@@ -114,6 +116,18 @@ async function upgrade() {
|
|
|
114
116
|
|
|
115
117
|
const latestVer = await getLatestVersion(tool.npmPkg)
|
|
116
118
|
|
|
119
|
+
if (!tool.npmPkg) {
|
|
120
|
+
console.log(`\r ${chalk.yellow('↑')} ${chalk.yellow(tool.name.padEnd(18))} ${chalk.gray('v' + (localVer || '?'))} → ${chalk.cyan('official installer')} `)
|
|
121
|
+
const success = runUpgrade(tool)
|
|
122
|
+
if (success) {
|
|
123
|
+
const newVer = getLocalVersion(tool)
|
|
124
|
+
console.log(` ${chalk.green('✓')} ${chalk.green(tool.name)} 升级成功 → ${chalk.cyan('v' + (newVer || 'latest'))}`)
|
|
125
|
+
upgraded++
|
|
126
|
+
}
|
|
127
|
+
console.log()
|
|
128
|
+
continue
|
|
129
|
+
}
|
|
130
|
+
|
|
117
131
|
if (!latestVer) {
|
|
118
132
|
console.log(chalk.yellow(' 无法获取最新版本'))
|
|
119
133
|
continue
|
|
@@ -142,7 +156,7 @@ async function upgrade() {
|
|
|
142
156
|
if (!hasInstalled) {
|
|
143
157
|
console.log(chalk.yellow('没有检测到已安装的 AI 编程工具。'))
|
|
144
158
|
console.log(chalk.gray('支持的工具: Claude Code, Codex CLI, Gemini CLI'))
|
|
145
|
-
console.log(chalk.gray('
|
|
159
|
+
console.log(chalk.gray(`安装示例: ${process.platform === 'win32' ? 'irm https://claude.ai/install.ps1 | iex' : 'curl -fsSL https://claude.ai/install.sh | bash'}`))
|
|
146
160
|
} else if (upgraded > 0) {
|
|
147
161
|
console.log(chalk.green(`✓ 升级了 ${upgraded} 个工具`))
|
|
148
162
|
} else if (alreadyLatest > 0) {
|
package/src/tools/claude-code.js
CHANGED
|
@@ -107,7 +107,9 @@ module.exports = {
|
|
|
107
107
|
getConfigPath() { return SETTINGS_FILE },
|
|
108
108
|
hint: '通过 HolySheep 本地 Bridge 接入,支持热切换,无需重启终端',
|
|
109
109
|
launchCmd: 'claude',
|
|
110
|
-
installCmd:
|
|
110
|
+
installCmd: process.platform === 'win32'
|
|
111
|
+
? 'irm https://claude.ai/install.ps1 | iex'
|
|
112
|
+
: 'curl -fsSL https://claude.ai/install.sh | bash',
|
|
111
113
|
docsUrl: 'https://docs.anthropic.com/claude-code',
|
|
112
114
|
getBridgePort() {
|
|
113
115
|
return getConfiguredBridgePort()
|