@simonyea/holysheep-cli 1.6.0 → 1.6.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/README.md +1 -1
- package/package.json +2 -2
- package/src/tools/droid.js +22 -22
package/README.md
CHANGED
|
@@ -38,7 +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/
|
|
41
|
+
| Droid CLI | `~/.factory/settings.json` | ✅ Auto |
|
|
42
42
|
| [Aider](https://aider.chat) | `~/.aider.conf.yml` | ✅ Auto |
|
|
43
43
|
| [Continue.dev](https://continue.dev) | `~/.continue/config.yaml` | ✅ Auto |
|
|
44
44
|
| [OpenCode](https://github.com/anomalyco/opencode) | `~/.config/opencode/opencode.json` | ✅ Auto |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simonyea/holysheep-cli",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.1",
|
|
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",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"homepage": "https://holysheep.ai",
|
|
43
43
|
"repository": {
|
|
44
44
|
"type": "git",
|
|
45
|
-
"url": "https://github.com/holysheep123/holysheep-cli"
|
|
45
|
+
"url": "git+https://github.com/holysheep123/holysheep-cli.git"
|
|
46
46
|
},
|
|
47
47
|
"license": "MIT",
|
|
48
48
|
"bin": {
|
package/src/tools/droid.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Droid CLI 适配器
|
|
3
|
-
* 配置文件: ~/.factory/
|
|
3
|
+
* 配置文件: ~/.factory/settings.json
|
|
4
4
|
*
|
|
5
5
|
* 使用 Droid 原生 customModels 配置 HolySheep 的多个模型入口:
|
|
6
6
|
* - GPT 走 OpenAI 兼容入口: https://api.holysheep.ai/openai
|
|
@@ -12,7 +12,7 @@ const path = require('path')
|
|
|
12
12
|
const os = require('os')
|
|
13
13
|
|
|
14
14
|
const CONFIG_DIR = path.join(os.homedir(), '.factory')
|
|
15
|
-
const
|
|
15
|
+
const SETTINGS_FILE = path.join(CONFIG_DIR, 'settings.json')
|
|
16
16
|
|
|
17
17
|
const DEFAULT_MODELS = [
|
|
18
18
|
{
|
|
@@ -52,18 +52,18 @@ const DEFAULT_MODELS = [
|
|
|
52
52
|
},
|
|
53
53
|
]
|
|
54
54
|
|
|
55
|
-
function
|
|
55
|
+
function readSettings() {
|
|
56
56
|
try {
|
|
57
|
-
if (fs.existsSync(
|
|
58
|
-
return JSON.parse(fs.readFileSync(
|
|
57
|
+
if (fs.existsSync(SETTINGS_FILE)) {
|
|
58
|
+
return JSON.parse(fs.readFileSync(SETTINGS_FILE, 'utf8'))
|
|
59
59
|
}
|
|
60
60
|
} catch {}
|
|
61
61
|
return {}
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
function
|
|
64
|
+
function writeSettings(data) {
|
|
65
65
|
fs.mkdirSync(CONFIG_DIR, { recursive: true })
|
|
66
|
-
fs.writeFileSync(
|
|
66
|
+
fs.writeFileSync(SETTINGS_FILE, JSON.stringify(data, null, 2), 'utf8')
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
function normalizeSelectedModels(selectedModels) {
|
|
@@ -106,43 +106,43 @@ module.exports = {
|
|
|
106
106
|
return require('../utils/which').commandExists('droid')
|
|
107
107
|
},
|
|
108
108
|
isConfigured() {
|
|
109
|
-
const
|
|
110
|
-
const customModels = Array.isArray(
|
|
109
|
+
const settings = readSettings()
|
|
110
|
+
const customModels = Array.isArray(settings.customModels) ? settings.customModels : []
|
|
111
111
|
return customModels.some((item) =>
|
|
112
112
|
typeof item.baseUrl === 'string' && item.baseUrl.includes('api.holysheep.ai')
|
|
113
113
|
)
|
|
114
114
|
},
|
|
115
115
|
configure(apiKey, baseUrlAnthropic, _baseUrlOpenAI, _primaryModel, selectedModels) {
|
|
116
|
-
const
|
|
117
|
-
const preservedModels = Array.isArray(
|
|
118
|
-
?
|
|
116
|
+
const settings = readSettings()
|
|
117
|
+
const preservedModels = Array.isArray(settings.customModels)
|
|
118
|
+
? settings.customModels.filter(
|
|
119
119
|
(item) => !(typeof item.baseUrl === 'string' && item.baseUrl.includes('api.holysheep.ai'))
|
|
120
120
|
)
|
|
121
121
|
: []
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
settings.customModels = [
|
|
124
124
|
...buildCustomModels(apiKey, baseUrlAnthropic, selectedModels),
|
|
125
125
|
...preservedModels,
|
|
126
126
|
]
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
settings.logoAnimation = 'off'
|
|
128
|
+
writeSettings(settings)
|
|
129
129
|
|
|
130
130
|
return {
|
|
131
|
-
file:
|
|
131
|
+
file: SETTINGS_FILE,
|
|
132
132
|
hot: true,
|
|
133
133
|
}
|
|
134
134
|
},
|
|
135
135
|
reset() {
|
|
136
|
-
const
|
|
137
|
-
if (Array.isArray(
|
|
138
|
-
|
|
136
|
+
const settings = readSettings()
|
|
137
|
+
if (Array.isArray(settings.customModels)) {
|
|
138
|
+
settings.customModels = settings.customModels.filter(
|
|
139
139
|
(item) => !(typeof item.baseUrl === 'string' && item.baseUrl.includes('api.holysheep.ai'))
|
|
140
140
|
)
|
|
141
141
|
}
|
|
142
|
-
|
|
142
|
+
writeSettings(settings)
|
|
143
143
|
},
|
|
144
|
-
getConfigPath() { return
|
|
145
|
-
hint: '已写入 ~/.factory/
|
|
144
|
+
getConfigPath() { return SETTINGS_FILE },
|
|
145
|
+
hint: '已写入 ~/.factory/settings.json;重启 Droid 后可见 HolySheep 模型列表',
|
|
146
146
|
launchCmd: 'droid',
|
|
147
147
|
installCmd: 'brew install --cask droid',
|
|
148
148
|
docsUrl: 'https://docs.factory.ai/cli/getting-started/overview',
|