skillfree 0.1.0 → 0.1.2

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/SKILL.md CHANGED
@@ -34,4 +34,4 @@ skillfree auth login
34
34
 
35
35
  ## 充值
36
36
 
37
- 充多少用多少,积分永不过期:https://skillfree.ai/billing
37
+ 充多少用多少,积分永不过期:https://skillfree.tech/billing
package/install.sh CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  # install.sh — SkillFree 一键安装脚本
3
- # curl -fsSL https://skillfree.ai/install.sh | bash
3
+ # curl -fsSL https://skillfree.tech/install.sh | bash
4
4
 
5
5
  set -e
6
6
 
@@ -31,7 +31,7 @@ success "CLI 安装完成"
31
31
 
32
32
  # ── 3. 输入 API Key ───────────────────────────────────────────────────────────
33
33
  echo ""
34
- echo -e " 请前往 ${CYAN}https://skillfree.ai/dashboard${NC} 获取 API Key"
34
+ echo -e " 请前往 ${CYAN}https://skillfree.tech/app${NC} 获取 API Key"
35
35
  read -rp " 输入你的 API Key (sk-sf-...): " API_KEY
36
36
 
37
37
  if [[ -z "$API_KEY" || "$API_KEY" != sk-sf-* ]]; then
@@ -55,7 +55,7 @@ else
55
55
  mkdir -p "$SKILL_SRC_DIR"
56
56
 
57
57
  # 下载 SKILL.md(龙虾技能描述)
58
- curl -fsSL "https://skillfree.ai/skill/SKILL.md" -o "$SKILL_SRC_DIR/SKILL.md" 2>/dev/null \
58
+ curl -fsSL "https://skillfree.tech/skill/SKILL.md" -o "$SKILL_SRC_DIR/SKILL.md" 2>/dev/null \
59
59
  || echo "# SkillFree\nUse skillfree CLI for AI tasks." > "$SKILL_SRC_DIR/SKILL.md"
60
60
 
61
61
  # OpenClaw
@@ -98,6 +98,6 @@ echo -e " ${CYAN}快速开始:${NC}"
98
98
  echo -e " $ skillfree pilot --type chat --prompt \"你好龙虾\""
99
99
  echo -e " $ skillfree pilot --type image --prompt \"赛博朋克的上海\" --output ./img.png"
100
100
  echo ""
101
- echo -e " ${CYAN}充值积分:${NC} https://skillfree.ai/billing"
102
- echo -e " ${CYAN}查看文档:${NC} https://skillfree.ai/docs"
101
+ echo -e " ${CYAN}充值积分:${NC} https://skillfree.tech/app/topup"
102
+ echo -e " ${CYAN}查看文档:${NC} https://skillfree.tech/app/docs"
103
103
  echo ""
package/package.json CHANGED
@@ -1,15 +1,22 @@
1
1
  {
2
2
  "name": "skillfree",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "🦞 一个 API,满足所有龙虾技能需求",
5
5
  "main": "bin/skillfree.js",
6
6
  "bin": {
7
7
  "skillfree": "./bin/skillfree.js"
8
8
  },
9
9
  "scripts": {
10
- "test": "node bin/skillfree.js --help"
10
+ "test": "node bin/skillfree.js --help",
11
+ "postinstall": "node postinstall.js"
11
12
  },
12
- "keywords": ["ai", "skillfree", "openclaw", "claude", "llm"],
13
+ "keywords": [
14
+ "ai",
15
+ "skillfree",
16
+ "openclaw",
17
+ "claude",
18
+ "llm"
19
+ ],
13
20
  "homepage": "https://skillfree.tech",
14
21
  "repository": {
15
22
  "type": "git",
package/postinstall.js ADDED
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * postinstall.js
4
+ * npm install -g skillfree 后自动将技能文件部署到 ~/.agents/skills/skillfree/
5
+ */
6
+
7
+ const fs = require('fs')
8
+ const path = require('path')
9
+ const os = require('os')
10
+
11
+ const SKILL_DIR = path.join(os.homedir(), '.agents', 'skills', 'skillfree')
12
+ const PKG_DIR = __dirname // 本文件在包根目录
13
+
14
+ // 需要复制到 skill 目录的文件
15
+ const FILES = ['SKILL.md', 'package.json']
16
+ const DIRS = ['bin', 'scripts']
17
+
18
+ function copyDir(src, dest) {
19
+ fs.mkdirSync(dest, { recursive: true })
20
+ for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
21
+ const srcPath = path.join(src, entry.name)
22
+ const destPath = path.join(dest, entry.name)
23
+ if (entry.isDirectory()) {
24
+ copyDir(srcPath, destPath)
25
+ } else {
26
+ fs.copyFileSync(srcPath, destPath)
27
+ }
28
+ }
29
+ }
30
+
31
+ try {
32
+ fs.mkdirSync(SKILL_DIR, { recursive: true })
33
+
34
+ // 复制文件
35
+ for (const f of FILES) {
36
+ const src = path.join(PKG_DIR, f)
37
+ if (fs.existsSync(src)) {
38
+ fs.copyFileSync(src, path.join(SKILL_DIR, f))
39
+ }
40
+ }
41
+
42
+ // 复制目录(排除 node_modules)
43
+ for (const d of DIRS) {
44
+ const src = path.join(PKG_DIR, d)
45
+ if (fs.existsSync(src)) {
46
+ copyDir(src, path.join(SKILL_DIR, d))
47
+ }
48
+ }
49
+
50
+ // 写一个 config 标记已安装
51
+ fs.writeFileSync(
52
+ path.join(SKILL_DIR, '.skillfree-installed'),
53
+ JSON.stringify({ installedAt: new Date().toISOString(), version: require('./package.json').version }, null, 2) + '\n'
54
+ )
55
+
56
+ console.log('✅ SkillFree skill 已安装到 ~/.agents/skills/skillfree/')
57
+ } catch (e) {
58
+ // 静默失败,不影响正常安装
59
+ }