@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 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/config.json` | ✅ Auto |
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.0",
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": {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Droid CLI 适配器
3
- * 配置文件: ~/.factory/config.json
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 CONFIG_FILE = path.join(CONFIG_DIR, 'config.json')
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 readConfig() {
55
+ function readSettings() {
56
56
  try {
57
- if (fs.existsSync(CONFIG_FILE)) {
58
- return JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'))
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 writeConfig(data) {
64
+ function writeSettings(data) {
65
65
  fs.mkdirSync(CONFIG_DIR, { recursive: true })
66
- fs.writeFileSync(CONFIG_FILE, JSON.stringify(data, null, 2), 'utf8')
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 config = readConfig()
110
- const customModels = Array.isArray(config.customModels) ? config.customModels : []
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 config = readConfig()
117
- const preservedModels = Array.isArray(config.customModels)
118
- ? config.customModels.filter(
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
- config.customModels = [
123
+ settings.customModels = [
124
124
  ...buildCustomModels(apiKey, baseUrlAnthropic, selectedModels),
125
125
  ...preservedModels,
126
126
  ]
127
- config.logoAnimation = 'off'
128
- writeConfig(config)
127
+ settings.logoAnimation = 'off'
128
+ writeSettings(settings)
129
129
 
130
130
  return {
131
- file: CONFIG_FILE,
131
+ file: SETTINGS_FILE,
132
132
  hot: true,
133
133
  }
134
134
  },
135
135
  reset() {
136
- const config = readConfig()
137
- if (Array.isArray(config.customModels)) {
138
- config.customModels = config.customModels.filter(
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
- writeConfig(config)
142
+ writeSettings(settings)
143
143
  },
144
- getConfigPath() { return CONFIG_FILE },
145
- hint: '已写入 ~/.factory/config.json;重启 Droid 后可见 HolySheep 模型列表',
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',