skillfree 0.1.22 → 0.1.24

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/bin/skillfree.js CHANGED
@@ -25,6 +25,13 @@ auth
25
25
  const { authSave } = require('../scripts/commands/auth')
26
26
  await authSave(apiKey)
27
27
  })
28
+ auth
29
+ .command('save <apiKey>')
30
+ .description('直接保存 API Key(供安装脚本调用)')
31
+ .action(async (apiKey) => {
32
+ const { authSave } = require('../scripts/commands/auth')
33
+ await authSave(apiKey)
34
+ })
28
35
  auth
29
36
  .command('status')
30
37
  .description('查看当前登录状态和积分')
package/install.sh CHANGED
@@ -116,20 +116,9 @@ while true; do
116
116
  continue
117
117
  fi
118
118
 
119
- # 验证 Key
120
- printf " 验证中..."
121
- HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" \
122
- -H "Authorization: Bearer $API_KEY" \
123
- "https://skillfree.tech/v1/balance")
124
-
125
- if [ "$HTTP_CODE" = "200" ]; then
126
- echo -e " ${GREEN}✓${NC}"
127
- break
128
- else
129
- echo -e " ${RED}✗${NC} (HTTP $HTTP_CODE)"
130
- echo -e " ${RED}✗${NC} Key 无效,请检查后重试\n"
131
- API_KEY=""
132
- fi
119
+ # 格式正确,直接保存(不做网络验证,避免 GFW 干扰)
120
+ success "API Key 已保存"
121
+ break
133
122
  done
134
123
 
135
124
  # 有效 Key → 交给 CLI 写入配置
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillfree",
3
- "version": "0.1.22",
3
+ "version": "0.1.24",
4
4
  "description": "🦞 一个 API,满足所有龙虾技能需求",
5
5
  "main": "bin/skillfree.js",
6
6
  "bin": {
@@ -125,6 +125,19 @@ async function authSave(apiKey) {
125
125
  console.log(` skillfree models # 查看所有可用模型`)
126
126
  }
127
127
 
128
+ async function authSave(apiKey) {
129
+ if (!apiKey || !apiKey.startsWith('sk-sf-')) {
130
+ console.error('❌ Key 格式不正确')
131
+ process.exit(1)
132
+ }
133
+ saveConfig({ apiKey })
134
+ injectToOpenclaw(apiKey)
135
+ console.log(`\n🎉 登录成功!`)
136
+ console.log(`\n快速开始:`)
137
+ console.log(` skillfree pilot --type chat --prompt "你好"`)
138
+ console.log(` skillfree models # 查看所有可用模型`)
139
+ }
140
+
128
141
  async function authStatus() {
129
142
  const { getApiKey, BASE_URL } = require('../lib/client')
130
143
  const key = getApiKey()