@simonyea/holysheep-cli 1.1.6 → 1.1.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/README.md CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
  <br/>
18
18
 
19
- [🚀 Get Started](#quick-start) · [📦 npm](https://www.npmjs.com/package/@simonyea/holysheep-cli) · [🐑 HolySheep](https://shop.holysheep.ai)
19
+ [🚀 Quick Start](#quick-start) · [📦 npm](https://www.npmjs.com/package/@simonyea/holysheep-cli) · [🌐 holysheep.ai](https://holysheep.ai)
20
20
 
21
21
  </div>
22
22
 
@@ -28,73 +28,50 @@
28
28
 
29
29
  ### What is HolySheep CLI?
30
30
 
31
- **HolySheep CLI** (`hs`) is a command-line tool that automatically configures all popular AI coding assistants to use [HolySheep API](https://shop.holysheep.ai) — a relay service that lets developers in China access Claude, GPT, and Gemini APIs **without a VPN**, at **¥1 = $1** exchange rate.
31
+ **HolySheep CLI** (`hs`) is a command-line tool that automatically configures all popular AI coding assistants to use [HolySheep API](https://holysheep.ai) — a relay service for accessing Claude, GPT, and Gemini APIs in China without a VPN.
32
32
 
33
- Instead of manually editing config files and environment variables for each tool, just run `hs setup` and you're done.
33
+ Instead of manually editing config files for each tool, run one command and you're done.
34
34
 
35
35
  ### Supported Tools
36
36
 
37
- | Tool | Install | Config Method | Status |
38
- |------|---------|---------------|--------|
39
- | [Claude Code](https://docs.anthropic.com/claude-code) | `npm i -g @anthropic-ai/claude-code` | `~/.claude/settings.json` | ✅ Auto |
40
- | [Codex CLI](https://github.com/openai/codex) | `npm i -g @openai/codex` | `~/.codex/config.toml` | ✅ Auto |
41
- | [Aider](https://aider.chat) | `pip install aider-install && aider-install` | `~/.aider.conf.yml` | ✅ Auto |
42
- | [Continue.dev](https://continue.dev) | VS Code marketplace | `~/.continue/config.yaml` | ✅ Auto |
43
- | [OpenCode](https://opencode.ai) | `brew install anomalyco/tap/opencode` | `~/.config/opencode/opencode.json` | ✅ Auto |
44
- | [OpenClaw](https://github.com/openclaw/openclaw) | `npm i -g openclaw@latest` | `~/.openclaw/openclaw.json` | ✅ Auto |
45
- | [Cursor](https://cursor.sh) | Download from website | GUI only (encrypted storage) | ⚠️ Manual |
46
- | [Gemini CLI](https://github.com/google-gemini/gemini-cli) | `npm i -g @google/gemini-cli` | Google protocol only | ❌ Not supported |
47
-
48
- > **Note on Cursor**: Cursor (2025+) requires logging into the official Cursor account. API keys are stored in encrypted secret storage that CLI cannot access. Manual configuration via `Settings → Models → Override OpenAI Base URL` is required after login.
37
+ | Tool | Config File | Status |
38
+ |------|-------------|--------|
39
+ | [Claude Code](https://docs.anthropic.com/claude-code) | `~/.claude/settings.json` | ✅ Auto |
40
+ | [Codex CLI](https://github.com/openai/codex) | `~/.codex/config.toml` | ✅ Auto |
41
+ | [Aider](https://aider.chat) | `~/.aider.conf.yml` | ✅ Auto |
42
+ | [Continue.dev](https://continue.dev) | `~/.continue/config.yaml` | ✅ Auto |
43
+ | [OpenCode](https://github.com/anomalyco/opencode) | `~/.config/opencode/opencode.json` | ✅ Auto |
44
+ | [OpenClaw](https://github.com/openclaw/openclaw) | `~/.openclaw/openclaw.json` | ✅ Auto |
45
+ | [Cursor](https://cursor.sh) | GUI (encrypted storage) | ⚠️ Manual |
46
+ | [Gemini CLI](https://github.com/google-gemini/gemini-cli) | Google protocol only | ❌ Not supported |
47
+
48
+ > **Cursor**: API keys are stored in encrypted secret storage. Configure manually via `Settings → Models → Override OpenAI Base URL`.
49
49
  >
50
- > **Note on Gemini CLI**: Gemini CLI uses Google's proprietary protocol and does not support custom relay endpoints. Use your own Google Gemini API Key from [aistudio.google.com](https://aistudio.google.com/apikey).
50
+ > **Gemini CLI**: Uses Google's proprietary protocol and does not support custom relay endpoints.
51
51
 
52
- ### Installation
53
-
54
- ```bash
55
- npm install -g @simonyea/holysheep-cli
56
- ```
57
-
58
- No npm? Try npx (no install needed):
52
+ ### Quick Start
59
53
 
60
54
  ```bash
61
55
  npx @simonyea/holysheep-cli@latest setup
62
56
  ```
63
57
 
64
- ### Quick Start
65
-
66
- **Step 1** — Sign up at **[shop.holysheep.ai](https://shop.holysheep.ai)** and get your API Key (`cr_xxx`)
67
-
68
- **Step 2** — Run setup:
58
+ Or install globally:
69
59
 
70
60
  ```bash
61
+ npm install -g @simonyea/holysheep-cli
71
62
  hs setup
72
63
  ```
73
64
 
74
- ```
75
- 🐑 HolySheep CLI — Configure AI Tools
76
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
77
- ? API Key (cr_xxx): cr_xxxxxxxxxxxxxxxx
78
- ? Select tools to configure:
79
- ✅ ● Claude Code (installed)
80
- ✅ ● Gemini CLI (installed)
81
- ○ Codex CLI (not installed)
82
- ○ Aider (not installed)
83
-
84
- ✓ Claude Code → ~/.claude/settings.json (hot reload, no restart needed)
85
- ✓ Gemini CLI → ~/.gemini/settings.json
86
- ✓ Env vars written to ~/.zshrc
87
-
88
- ✅ Done! All tools configured.
89
- ```
65
+ You'll be prompted for your API Key (`cr_xxx`), then the tool will auto-detect installed AI tools and configure them all.
90
66
 
91
67
  ### Commands
92
68
 
93
69
  | Command | Description |
94
70
  |---------|-------------|
95
71
  | `hs setup` | Configure all AI tools interactively |
72
+ | `hs login` | Save your API Key locally |
96
73
  | `hs doctor` | Check configuration status & connectivity |
97
- | `hs balance` | View account balance and usage |
74
+ | `hs balance` | View account balance |
98
75
  | `hs tools` | List all supported tools |
99
76
  | `hs reset` | Remove all HolySheep configuration |
100
77
 
@@ -105,13 +82,6 @@ hs setup
105
82
  | Anthropic SDK / Claude Code | `https://api.holysheep.ai` (no `/v1`) |
106
83
  | OpenAI-compatible / Codex / Aider | `https://api.holysheep.ai/v1` (with `/v1`) |
107
84
 
108
- ### Why HolySheep?
109
-
110
- - 🇨🇳 **China-accessible** — Direct connection, no VPN needed
111
- - 💰 **Best rate** — ¥1 = $1, balance never expires, pay-as-you-go
112
- - ⚡ **All major models** — Claude 3.5/3.7, GPT-4o, Gemini 1.5 Pro and more
113
- - 🔒 **Official relay** — Direct passthrough to official APIs, no censorship
114
-
115
85
  ---
116
86
 
117
87
  <a name="chinese"></a>
@@ -120,75 +90,50 @@ hs setup
120
90
 
121
91
  ### 什么是 HolySheep CLI?
122
92
 
123
- **HolySheep CLI**(命令 `hs`)是一个命令行工具,帮你一键配置所有主流 AI 编程助手接入 [HolySheep API](https://shop.holysheep.ai)。
124
-
125
- HolySheep 是面向中国开发者的 Claude/GPT/Gemini 官方 API 中转服务,**国内直连、无需翻墙、¥1=$1**。
93
+ **HolySheep CLI**(命令 `hs`)是一个命令行工具,帮你一键配置所有主流 AI 编程助手接入 [HolySheep API](https://holysheep.ai)。
126
94
 
127
- 不用再逐个工具手动改配置文件和环境变量,执行 `hs setup` 一步搞定。
95
+ 不用再逐个工具手动改配置文件和环境变量,运行一条命令全部搞定。
128
96
 
129
97
  ### 支持的工具
130
98
 
131
- | 工具 | 安装方式 | 配置方式 | 状态 |
132
- |------|---------|---------|------|
133
- | [Claude Code](https://docs.anthropic.com/claude-code) | `npm i -g @anthropic-ai/claude-code` | `~/.claude/settings.json` | ✅ 自动 |
134
- | [Codex CLI](https://github.com/openai/codex) | `npm i -g @openai/codex` | `~/.codex/config.toml` | ✅ 自动 |
135
- | [Aider](https://aider.chat) | `pip install aider-install && aider-install` | `~/.aider.conf.yml` | ✅ 自动 |
136
- | [Continue.dev](https://continue.dev) | VS Code 插件市场 | `~/.continue/config.yaml` | ✅ 自动 |
137
- | [OpenCode](https://opencode.ai) | `brew install anomalyco/tap/opencode` | `~/.config/opencode/opencode.json` | ✅ 自动 |
138
- | [OpenClaw](https://github.com/openclaw/openclaw) | `npm i -g openclaw@latest` | `~/.openclaw/openclaw.json` | ✅ 自动 |
139
- | [Cursor](https://cursor.sh) | 官网下载 | GUI 手动配置(加密存储) | ⚠️ 手动 |
140
- | [Gemini CLI](https://github.com/google-gemini/gemini-cli) | `npm i -g @google/gemini-cli` | 仅支持 Google 官方协议 | ❌ 不支持 |
141
-
142
- > **关于 Cursor**:Cursor 新版(2025+)必须登录官方账号,API Key 存储在加密区域,CLI 无法写入。需登录后在 `Settings → Models → Override OpenAI Base URL` 手动填入。
99
+ | 工具 | 配置文件 | 状态 |
100
+ |------|---------|------|
101
+ | [Claude Code](https://docs.anthropic.com/claude-code) | `~/.claude/settings.json` | ✅ 自动 |
102
+ | [Codex CLI](https://github.com/openai/codex) | `~/.codex/config.toml` | ✅ 自动 |
103
+ | [Aider](https://aider.chat) | `~/.aider.conf.yml` | ✅ 自动 |
104
+ | [Continue.dev](https://continue.dev) | `~/.continue/config.yaml` | ✅ 自动 |
105
+ | [OpenCode](https://github.com/anomalyco/opencode) | `~/.config/opencode/opencode.json` | ✅ 自动 |
106
+ | [OpenClaw](https://github.com/openclaw/openclaw) | `~/.openclaw/openclaw.json` | ✅ 自动 |
107
+ | [Cursor](https://cursor.sh) | GUI(加密存储) | ⚠️ 手动 |
108
+ | [Gemini CLI](https://github.com/google-gemini/gemini-cli) | 仅支持 Google 官方协议 | ❌ 不支持 |
109
+
110
+ > **Cursor**:API Key 存储在加密区域,CLI 无法写入。登录后在 `Settings → Models → Override OpenAI Base URL` 手动填入。
143
111
  >
144
- > **关于 Gemini CLI**:Gemini CLI 使用 Google 专有协议,不支持自定义中转地址。需使用从 [aistudio.google.com](https://aistudio.google.com/apikey) 获取的 Google Gemini API Key。
112
+ > **Gemini CLI**:使用 Google 专有协议,不支持自定义中转地址。
145
113
 
146
- ### 安装
147
-
148
- ```bash
149
- npm install -g @simonyea/holysheep-cli
150
- ```
151
-
152
- 没有 npm?用 npx 免安装直接运行:
114
+ ### 快速开始
153
115
 
154
116
  ```bash
155
117
  npx @simonyea/holysheep-cli@latest setup
156
118
  ```
157
119
 
158
- ### 快速开始
159
-
160
- **第一步** — 前往 **[shop.holysheep.ai](https://shop.holysheep.ai)** 注册账号,充值后创建 API Key(`cr_` 开头)
161
-
162
- **第二步** — 运行配置向导:
120
+ 或全局安装:
163
121
 
164
122
  ```bash
123
+ npm install -g @simonyea/holysheep-cli
165
124
  hs setup
166
125
  ```
167
126
 
168
- ```
169
- 🐑 HolySheep CLI — 一键配置 AI 工具
170
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
171
- ? API Key (cr_xxx): cr_xxxxxxxxxxxxxxxx
172
- ? 选择要配置的工具:
173
- ✅ ● Claude Code (已安装)
174
- ✅ ● Gemini CLI (已安装)
175
- ○ Codex CLI (未安装)
176
- ○ Aider (未安装)
177
-
178
- ✓ Claude Code → ~/.claude/settings.json (热切换,无需重启)
179
- ✓ Gemini CLI → ~/.gemini/settings.json
180
- ✓ 环境变量已写入 ~/.zshrc
181
-
182
- ✅ 配置完成!
183
- ```
127
+ 按提示输入 API Key(`cr_xxx`),工具会自动检测已安装的 AI 工具并完成配置。
184
128
 
185
129
  ### 命令说明
186
130
 
187
131
  | 命令 | 说明 |
188
132
  |------|------|
189
133
  | `hs setup` | 交互式配置所有 AI 工具 |
134
+ | `hs login` | 登录并保存 API Key 到本地 |
190
135
  | `hs doctor` | 检查配置状态和连通性 |
191
- | `hs balance` | 查看账户余额和用量 |
136
+ | `hs balance` | 查看账户余额 |
192
137
  | `hs tools` | 列出所有支持的工具 |
193
138
  | `hs reset` | 清除所有 HolySheep 配置 |
194
139
 
@@ -199,26 +144,22 @@ hs setup
199
144
  | Anthropic SDK / Claude Code | `https://api.holysheep.ai`(不带 /v1) |
200
145
  | OpenAI 兼容 / Codex / Aider | `https://api.holysheep.ai/v1`(带 /v1) |
201
146
 
202
- ### 为什么选 HolySheep?
203
-
204
- - 🇨🇳 **国内直连** — 无需代理,开箱即用
205
- - 💰 **全网最优汇率** — ¥1=$1,余额永久有效,按量计费
206
- - ⚡ **全主流模型** — Claude 3.5/3.7、GPT-4o、Gemini 1.5 Pro 等
207
- - 🔒 **官方直转** — 直连官方 API,无任何阉割
208
-
209
147
  ### 常见问题
210
148
 
211
- **Q: API Key 格式是什么?**
212
- A: `cr_` 开头的字符串,在 [shop.holysheep.ai](https://shop.holysheep.ai) 控制台「API 密钥」页面创建。
149
+ **Q: API Key 在哪里获取?**
150
+ A: [holysheep.ai](https://holysheep.ai) 注册后,在「API 密钥」页面创建,格式为 `cr_xxx`。
213
151
 
214
152
  **Q: 支持 Windows 吗?**
215
- A: 支持,需要 Node.js 16+。环境变量会写入用户目录下的 shell 配置文件。
153
+ A: 支持,需要 Node.js 16+。如果 `hs` 命令找不到,请重启终端,或直接用 `npx @simonyea/holysheep-cli@latest setup`。
216
154
 
217
155
  **Q: 如何恢复原来的配置?**
218
- A: 运行 `hs reset` 即可清除所有 HolySheep 相关配置。
156
+ A: 运行 `hs reset` 清除所有 HolySheep 相关配置。
157
+
158
+ **Q: OpenClaw 安装失败?**
159
+ A: OpenClaw 需要 Node.js 22+,运行 `node --version` 确认版本后重试。
219
160
 
220
161
  ---
221
162
 
222
163
  ## License
223
164
 
224
- MIT © [HolySheep](https://shop.holysheep.ai)
165
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simonyea/holysheep-cli",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "description": "一键配置所有 AI 编程工具接入 HolySheep API — Claude Code / Codex / Gemini CLI / OpenCode / OpenClaw / Aider / Cursor",
5
5
  "keywords": [
6
6
  "claude",
@@ -51,6 +51,9 @@ async function tryAutoInstall(tool) {
51
51
  if (process.platform !== 'win32' && !tool.checkInstalled()) {
52
52
  console.log(chalk.yellow(` ⚠ 安装后未检测到命令,尝试直接配置...`))
53
53
  }
54
+ if (process.platform === 'win32') {
55
+ tool._winJustInstalled = true // 标记为 Windows 刚装的,摘要里特殊处理
56
+ }
54
57
  return true // 安装成功就视为可配置
55
58
  } catch (e) {
56
59
  spinner.fail(`安装失败: ${e.message}`)
@@ -234,6 +237,24 @@ async function setup(options) {
234
237
  const hot = r.result?.hot ? chalk.cyan(' (热切换,无需重启)') : chalk.gray(' (重启终端生效)')
235
238
  console.log(` ✓ ${r.tool.name}${hot}`)
236
239
  if (r.tool.hint) console.log(` ${chalk.gray('💡 ' + r.tool.hint)}`)
240
+ // 显示启动命令
241
+ if (r.tool.launchCmd) {
242
+ if (r.tool._winJustInstalled) {
243
+ // Windows 刚安装:PATH 未刷新,提示用 npx 或重开终端
244
+ console.log(` ${chalk.yellow('▶ Windows:新开一个终端后运行:')} ${chalk.cyan.bold(r.tool.launchCmd)}`)
245
+ const cmdBin = r.tool.launchCmd.split(' ')[0]
246
+ const cmdArgs = r.tool.launchCmd.split(' ').slice(1).join(' ')
247
+ console.log(` ${chalk.gray(' 或现在用 npx 直接运行:')} ${chalk.cyan.bold('npx ' + cmdBin + (cmdArgs ? ' ' + cmdArgs : ''))}`)
248
+ if (r.tool.launchNote) console.log(` ${chalk.gray(' ' + r.tool.launchNote)}`)
249
+ } else {
250
+ console.log(` ${chalk.gray('▶ 启动命令:')} ${chalk.cyan.bold(r.tool.launchCmd)}`)
251
+ }
252
+ } else if (r.tool.launchNote) {
253
+ console.log(` ${chalk.gray('▶ ' + r.tool.launchNote)}`)
254
+ }
255
+ if (r.tool.launchNote && r.tool.launchCmd && !r.tool._winJustInstalled) {
256
+ console.log(` ${chalk.gray(' ' + r.tool.launchNote)}`)
257
+ }
237
258
  })
238
259
  console.log()
239
260
  }
@@ -66,6 +66,7 @@ model: openai/claude-sonnet-4-5
66
66
  },
67
67
  getConfigPath() { return CONFIG_FILE },
68
68
  hint: '也可用 aider --openai-api-base https://api.holysheep.ai/v1',
69
+ launchCmd: 'aider',
69
70
  installCmd: 'pip install aider-chat',
70
71
  docsUrl: 'https://aider.chat',
71
72
  // Aider 优先用环境变量
@@ -64,6 +64,7 @@ module.exports = {
64
64
  },
65
65
  getConfigPath() { return SETTINGS_FILE },
66
66
  hint: '支持热切换,无需重启终端',
67
+ launchCmd: 'claude',
67
68
  installCmd: 'npm install -g @anthropic-ai/claude-code',
68
69
  docsUrl: 'https://docs.anthropic.com/claude-code',
69
70
  }
@@ -154,6 +154,7 @@ module.exports = {
154
154
  },
155
155
  getConfigPath() { return CONFIG_FILE },
156
156
  hint: '切换后重开终端生效;Rust Codex (v0.111+) 使用 config.toml',
157
+ launchCmd: 'codex',
157
158
  installCmd: 'npm install -g @openai/codex',
158
159
  docsUrl: 'https://github.com/openai/codex',
159
160
  envVarFormat: 'openai',
@@ -139,6 +139,8 @@ module.exports = {
139
139
  },
140
140
  getConfigPath() { return fs.existsSync(CONFIG_YAML) ? CONFIG_YAML : CONFIG_JSON },
141
141
  hint: '新版使用 config.yaml;配置后在 VS Code Continue 面板选择 HolySheep 模型',
142
+ launchCmd: null, // VS Code 插件,在编辑器内使用
143
+ launchNote: '在 VS Code 侧边栏打开 Continue 面板即可使用',
142
144
  installCmd: 'VS Code 插件市场搜索 "Continue"',
143
145
  docsUrl: 'https://continue.dev',
144
146
  }
@@ -98,6 +98,8 @@ module.exports = {
98
98
  },
99
99
  getConfigPath() { return CONFIG_FILE },
100
100
  hint: '切换后重启 OpenClaw 生效;支持 /model 命令切换模型',
101
+ launchCmd: 'openclaw dashboard',
102
+ launchNote: '启动后访问 http://127.0.0.1:18789/ 打开 WebUI',
101
103
  installCmd: 'npm install -g openclaw@latest',
102
104
  docsUrl: 'https://docs.openclaw.ai',
103
105
  }
@@ -122,6 +122,7 @@ module.exports = {
122
122
  },
123
123
  getConfigPath() { return getConfigFile() },
124
124
  hint: '切换后重启 OpenCode 生效;配置文件: ~/.config/opencode/opencode.json',
125
+ launchCmd: 'opencode',
125
126
  installCmd: 'brew install anomalyco/tap/opencode # 或: npm i -g opencode-ai@latest',
126
127
  docsUrl: 'https://opencode.ai',
127
128
  }