@simonyea/holysheep-cli 1.5.9 → 1.6.0
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 +3 -0
- package/package.json +1 -1
- package/src/commands/doctor.js +1 -0
- package/src/commands/setup.js +5 -3
- package/src/index.js +1 -1
- package/src/tools/droid.js +149 -0
- package/src/tools/index.js +1 -0
package/README.md
CHANGED
|
@@ -38,6 +38,7 @@ Instead of manually editing config files for each tool, run one command and you'
|
|
|
38
38
|
|------|-------------|--------|
|
|
39
39
|
| [Claude Code](https://docs.anthropic.com/claude-code) | `~/.claude/settings.json` | ✅ Auto |
|
|
40
40
|
| [Codex CLI](https://github.com/openai/codex) | `~/.codex/config.toml` | ✅ Auto |
|
|
41
|
+
| Droid CLI | `~/.factory/config.json` | ✅ Auto |
|
|
41
42
|
| [Aider](https://aider.chat) | `~/.aider.conf.yml` | ✅ Auto |
|
|
42
43
|
| [Continue.dev](https://continue.dev) | `~/.continue/config.yaml` | ✅ Auto |
|
|
43
44
|
| [OpenCode](https://github.com/anomalyco/opencode) | `~/.config/opencode/opencode.json` | ✅ Auto |
|
|
@@ -113,6 +114,7 @@ npx openclaw gateway --port 18789
|
|
|
113
114
|
|------|------|------|
|
|
114
115
|
| [Claude Code](https://docs.anthropic.com/claude-code) | ✅ 自动 | Anthropic 官方 CLI |
|
|
115
116
|
| [Codex CLI](https://github.com/openai/codex) | ✅ 自动 | OpenAI 官方 CLI |
|
|
117
|
+
| Droid CLI | ✅ 自动 | Factory AI 终端智能体 |
|
|
116
118
|
| [Aider](https://aider.chat) | ✅ 自动 | AI 结对编程 |
|
|
117
119
|
| [Continue.dev](https://continue.dev) | ✅ 自动 | VS Code/JetBrains 插件 |
|
|
118
120
|
| [OpenCode](https://github.com/anomalyco/opencode) | ✅ 自动 | 终端 AI 编程助手 |
|
|
@@ -195,6 +197,7 @@ A: OpenClaw 需要 Node.js 20+,运行 `node --version` 确认版本后重试
|
|
|
195
197
|
|
|
196
198
|
## Changelog
|
|
197
199
|
|
|
200
|
+
- **v1.6.0** — 新增 Droid CLI 一键配置,默认写入 GPT-5.4 / Sonnet 4.6 / Opus 4.6 / MiniMax 2.7 Highspeed / Haiku 4.5
|
|
198
201
|
- **v1.5.2** — OpenClaw 安装失败(无 git 环境)时自动降级为 npx 模式继续配置
|
|
199
202
|
- **v1.5.0** — OpenClaw gateway 无需 token,直接浏览器打开 http://127.0.0.1:18789/
|
|
200
203
|
- **v1.4.6** — 基于实测正确配置格式,彻底修复 OpenClaw 401 认证问题
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simonyea/holysheep-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
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/doctor.js
CHANGED
package/src/commands/setup.js
CHANGED
|
@@ -112,9 +112,11 @@ async function setup(options) {
|
|
|
112
112
|
|
|
113
113
|
// Step 1.5: 选择要配置的模型
|
|
114
114
|
const MODEL_CHOICES = [
|
|
115
|
-
{ name: '
|
|
116
|
-
{ name: 'claude-
|
|
117
|
-
{ name: '
|
|
115
|
+
{ name: 'gpt-5.4 (GPT 5.4, 通用编码)', value: 'gpt-5.4', checked: true },
|
|
116
|
+
{ name: 'claude-sonnet-4-6 (Sonnet 4.6, 均衡推荐)', value: 'claude-sonnet-4-6', checked: true },
|
|
117
|
+
{ name: 'claude-opus-4-6 (Opus 4.6, 强力旗舰)', value: 'claude-opus-4-6', checked: true },
|
|
118
|
+
{ name: 'MiniMax-M2.7-highspeed (高速经济版)', value: 'MiniMax-M2.7-highspeed', checked: true },
|
|
119
|
+
{ name: 'claude-haiku-4-5 (Haiku 4.5, 轻快便宜)', value: 'claude-haiku-4-5', checked: true },
|
|
118
120
|
]
|
|
119
121
|
const { selectedModels } = await inquirer.prompt([{
|
|
120
122
|
type: 'checkbox',
|
package/src/index.js
CHANGED
|
@@ -56,7 +56,7 @@ program
|
|
|
56
56
|
🐑 HolySheep CLI v${pkg.version}
|
|
57
57
|
官方 Claude / GPT / Gemini API · ¥1=$1 · https://holysheep.ai
|
|
58
58
|
|
|
59
|
-
支持工具: Claude Code · Codex · Gemini CLI · OpenCode · OpenClaw · Aider · Cursor · Continue
|
|
59
|
+
支持工具: Claude Code · Codex · Droid · Gemini CLI · OpenCode · OpenClaw · Aider · Cursor · Continue
|
|
60
60
|
`)
|
|
61
61
|
|
|
62
62
|
// ── login ────────────────────────────────────────────────────────────────────
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Droid CLI 适配器
|
|
3
|
+
* 配置文件: ~/.factory/config.json
|
|
4
|
+
*
|
|
5
|
+
* 使用 Droid 原生 customModels 配置 HolySheep 的多个模型入口:
|
|
6
|
+
* - GPT 走 OpenAI 兼容入口: https://api.holysheep.ai/openai
|
|
7
|
+
* - Claude 走 Anthropic 入口: https://api.holysheep.ai
|
|
8
|
+
* - MiniMax 走 Anthropic 入口: https://api.holysheep.ai/minimax
|
|
9
|
+
*/
|
|
10
|
+
const fs = require('fs')
|
|
11
|
+
const path = require('path')
|
|
12
|
+
const os = require('os')
|
|
13
|
+
|
|
14
|
+
const CONFIG_DIR = path.join(os.homedir(), '.factory')
|
|
15
|
+
const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json')
|
|
16
|
+
|
|
17
|
+
const DEFAULT_MODELS = [
|
|
18
|
+
{
|
|
19
|
+
model: 'gpt-5.4',
|
|
20
|
+
id: 'custom:gpt-5.4-0',
|
|
21
|
+
baseUrlSuffix: '/openai',
|
|
22
|
+
displayName: 'GPT-5.4',
|
|
23
|
+
provider: 'openai',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
model: 'claude-sonnet-4-6',
|
|
27
|
+
id: 'custom:claude-sonnet-4-6-0',
|
|
28
|
+
baseUrlSuffix: '',
|
|
29
|
+
displayName: 'Sonnet 4.6',
|
|
30
|
+
provider: 'anthropic',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
model: 'claude-opus-4-6',
|
|
34
|
+
id: 'custom:claude-opus-4-6-0',
|
|
35
|
+
baseUrlSuffix: '',
|
|
36
|
+
displayName: 'Opus 4.6',
|
|
37
|
+
provider: 'anthropic',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
model: 'MiniMax-M2.7-highspeed',
|
|
41
|
+
id: 'custom:MiniMax-M2.7-highspeed-0',
|
|
42
|
+
baseUrlSuffix: '/minimax',
|
|
43
|
+
displayName: 'MiniMax 2.7 Highspeed',
|
|
44
|
+
provider: 'anthropic',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
model: 'claude-haiku-4-5',
|
|
48
|
+
id: 'custom:claude-haiku-4-5-0',
|
|
49
|
+
baseUrlSuffix: '',
|
|
50
|
+
displayName: 'Haiku 4.5',
|
|
51
|
+
provider: 'anthropic',
|
|
52
|
+
},
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
function readConfig() {
|
|
56
|
+
try {
|
|
57
|
+
if (fs.existsSync(CONFIG_FILE)) {
|
|
58
|
+
return JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'))
|
|
59
|
+
}
|
|
60
|
+
} catch {}
|
|
61
|
+
return {}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function writeConfig(data) {
|
|
65
|
+
fs.mkdirSync(CONFIG_DIR, { recursive: true })
|
|
66
|
+
fs.writeFileSync(CONFIG_FILE, JSON.stringify(data, null, 2), 'utf8')
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function normalizeSelectedModels(selectedModels) {
|
|
70
|
+
const selected = new Set(
|
|
71
|
+
Array.isArray(selectedModels) && selectedModels.length > 0
|
|
72
|
+
? selectedModels
|
|
73
|
+
: DEFAULT_MODELS.map((item) => item.model)
|
|
74
|
+
)
|
|
75
|
+
const models = DEFAULT_MODELS.filter((item) => selected.has(item.model)).map((item, index) => ({
|
|
76
|
+
model: item.model,
|
|
77
|
+
id: item.id,
|
|
78
|
+
index,
|
|
79
|
+
baseUrlSuffix: item.baseUrlSuffix,
|
|
80
|
+
displayName: item.displayName,
|
|
81
|
+
provider: item.provider,
|
|
82
|
+
}))
|
|
83
|
+
|
|
84
|
+
return models.length > 0 ? models : DEFAULT_MODELS.map((item, index) => ({ ...item, index }))
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function buildCustomModels(apiKey, baseUrlAnthropic, selectedModels) {
|
|
88
|
+
const rootUrl = String(baseUrlAnthropic || '').replace(/\/+$/, '')
|
|
89
|
+
return normalizeSelectedModels(selectedModels).map((item) => ({
|
|
90
|
+
model: item.model,
|
|
91
|
+
id: item.id,
|
|
92
|
+
index: item.index,
|
|
93
|
+
baseUrl: `${rootUrl}${item.baseUrlSuffix}`,
|
|
94
|
+
apiKey,
|
|
95
|
+
displayName: item.displayName,
|
|
96
|
+
maxOutputTokens: 64000,
|
|
97
|
+
noImageSupport: true,
|
|
98
|
+
provider: item.provider,
|
|
99
|
+
}))
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
module.exports = {
|
|
103
|
+
name: 'Droid CLI',
|
|
104
|
+
id: 'droid',
|
|
105
|
+
checkInstalled() {
|
|
106
|
+
return require('../utils/which').commandExists('droid')
|
|
107
|
+
},
|
|
108
|
+
isConfigured() {
|
|
109
|
+
const config = readConfig()
|
|
110
|
+
const customModels = Array.isArray(config.customModels) ? config.customModels : []
|
|
111
|
+
return customModels.some((item) =>
|
|
112
|
+
typeof item.baseUrl === 'string' && item.baseUrl.includes('api.holysheep.ai')
|
|
113
|
+
)
|
|
114
|
+
},
|
|
115
|
+
configure(apiKey, baseUrlAnthropic, _baseUrlOpenAI, _primaryModel, selectedModels) {
|
|
116
|
+
const config = readConfig()
|
|
117
|
+
const preservedModels = Array.isArray(config.customModels)
|
|
118
|
+
? config.customModels.filter(
|
|
119
|
+
(item) => !(typeof item.baseUrl === 'string' && item.baseUrl.includes('api.holysheep.ai'))
|
|
120
|
+
)
|
|
121
|
+
: []
|
|
122
|
+
|
|
123
|
+
config.customModels = [
|
|
124
|
+
...buildCustomModels(apiKey, baseUrlAnthropic, selectedModels),
|
|
125
|
+
...preservedModels,
|
|
126
|
+
]
|
|
127
|
+
config.logoAnimation = 'off'
|
|
128
|
+
writeConfig(config)
|
|
129
|
+
|
|
130
|
+
return {
|
|
131
|
+
file: CONFIG_FILE,
|
|
132
|
+
hot: true,
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
reset() {
|
|
136
|
+
const config = readConfig()
|
|
137
|
+
if (Array.isArray(config.customModels)) {
|
|
138
|
+
config.customModels = config.customModels.filter(
|
|
139
|
+
(item) => !(typeof item.baseUrl === 'string' && item.baseUrl.includes('api.holysheep.ai'))
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
writeConfig(config)
|
|
143
|
+
},
|
|
144
|
+
getConfigPath() { return CONFIG_FILE },
|
|
145
|
+
hint: '已写入 ~/.factory/config.json;重启 Droid 后可见 HolySheep 模型列表',
|
|
146
|
+
launchCmd: 'droid',
|
|
147
|
+
installCmd: 'brew install --cask droid',
|
|
148
|
+
docsUrl: 'https://docs.factory.ai/cli/getting-started/overview',
|
|
149
|
+
}
|