skillfree 0.1.22 → 0.1.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillfree",
3
- "version": "0.1.22",
3
+ "version": "0.1.23",
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()