skill-atlas-cli 0.1.30 → 0.1.31

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.
Files changed (3) hide show
  1. package/install.ps1 +125 -0
  2. package/package.json +2 -1
  3. package/skillhub.md +19 -1
package/install.ps1 ADDED
@@ -0,0 +1,125 @@
1
+ # ==============================================================================
2
+ # SkillAtlas CLI - Windows 安装脚本
3
+ # 用法: 在 PowerShell 中执行
4
+ # irm https://unpkg.com/skill-atlas-cli/install.ps1 | iex
5
+ # 或
6
+ # Invoke-RestMethod -Uri https://unpkg.com/skill-atlas-cli/install.ps1 | Invoke-Expression
7
+ # ==============================================================================
8
+
9
+ $ErrorActionPreference = 'Stop'
10
+ $INSTALL_ARCHIVE_URL = 'https://maas-skill-hub-cli.oss-cn-hangzhou.aliyuncs.com/install.tar.gz'
11
+ $PACKAGE_NAME = 'skill-atlas-cli'
12
+ $MIN_NODE_VERSION = '20.19.0'
13
+
14
+ function Write-Step { param($msg) Write-Host "`n▶ $msg" -ForegroundColor Blue }
15
+ function Write-Success { param($msg) Write-Host "✓ $msg" -ForegroundColor Green }
16
+ function Write-Warning { param($msg) Write-Host "⚠ $msg" -ForegroundColor Yellow }
17
+ function Write-Error { param($msg) Write-Host "✗ $msg" -ForegroundColor Red }
18
+ function Write-Info { param($msg) Write-Host "ℹ $msg" -ForegroundColor Cyan }
19
+
20
+ function Get-TempDir {
21
+ $dir = Join-Path $env:TEMP "skill-atlas-install-$(Get-Random)"
22
+ New-Item -ItemType Directory -Path $dir -Force | Out-Null
23
+ return $dir
24
+ }
25
+
26
+ function Test-NodeVersion {
27
+ param([string]$current, [string]$min)
28
+ $c = [version]($current -replace '^v', '')
29
+ $m = [version]$min
30
+ return $c -ge $m
31
+ }
32
+
33
+ try {
34
+ Write-Host ""
35
+ Write-Host "╔══════════════════════════════════════════════════════════════╗" -ForegroundColor Cyan
36
+ Write-Host "║ 🚀 Skill-Atlas CLI 安装程序 (Windows) ║" -ForegroundColor Cyan
37
+ Write-Host "╚══════════════════════════════════════════════════════════════╝" -ForegroundColor Cyan
38
+ Write-Host ""
39
+
40
+ # 检测 npm
41
+ Write-Step "检测 npm 环境..."
42
+ $npmCmd = Get-Command npm -ErrorAction SilentlyContinue
43
+ if (-not $npmCmd) {
44
+ Write-Error "未找到 npm,请先安装 Node.js: https://nodejs.org/"
45
+ exit 1
46
+ }
47
+ Write-Success "npm: $($npmCmd.Source)"
48
+
49
+ # 检测 Node.js
50
+ Write-Step "检测 Node.js 环境..."
51
+ $nodeVersion = $null
52
+ try {
53
+ $nodeVersion = (node -v 2>$null) -replace '^v', ''
54
+ } catch {}
55
+ if (-not $nodeVersion) {
56
+ Write-Error "未找到 Node.js,请先安装: https://nodejs.org/ (需要 >= v$MIN_NODE_VERSION)"
57
+ exit 1
58
+ }
59
+ if (-not (Test-NodeVersion $nodeVersion $MIN_NODE_VERSION)) {
60
+ Write-Warning "Node.js v$nodeVersion 版本过低,需要 >= v$MIN_NODE_VERSION"
61
+ } else {
62
+ Write-Success "Node.js: v$nodeVersion"
63
+ }
64
+
65
+ # 下载并解压
66
+ $tmpDir = Get-TempDir
67
+ try {
68
+ Write-Step "下载安装包..."
69
+ $archivePath = Join-Path $tmpDir 'install.tar.gz'
70
+ Invoke-WebRequest -Uri $INSTALL_ARCHIVE_URL -OutFile $archivePath -UseBasicParsing
71
+
72
+ Write-Step "解压..."
73
+ $extractDir = Join-Path $tmpDir 'extract'
74
+ New-Item -ItemType Directory -Path $extractDir -Force | Out-Null
75
+ tar -xzf $archivePath -C $extractDir
76
+
77
+ # 安装 CLI
78
+ Write-Step "安装 $PACKAGE_NAME..."
79
+ npm install -g $PACKAGE_NAME --force
80
+ Write-Success "$PACKAGE_NAME 安装成功"
81
+
82
+ # 安装 OpenClaw 插件(如存在 plugin 目录)
83
+ $pluginSrc = Join-Path $extractDir 'plugin'
84
+ $pluginTarget = Join-Path $env:USERPROFILE '.openclaw\extensions\skillAtlas'
85
+ if (Test-Path (Join-Path $pluginSrc 'index.ts')) {
86
+ Write-Step "安装 OpenClaw 插件..."
87
+ New-Item -ItemType Directory -Path $pluginTarget -Force | Out-Null
88
+ Copy-Item (Join-Path $pluginSrc 'index.ts') $pluginTarget -Force
89
+ Copy-Item (Join-Path $pluginSrc 'openclaw.plugin.json') $pluginTarget -Force
90
+ Write-Success "插件已安装到: $pluginTarget"
91
+ }
92
+ } finally {
93
+ Remove-Item -Path $tmpDir -Recurse -Force -ErrorAction SilentlyContinue
94
+ }
95
+
96
+ # 验证
97
+ Write-Step "验证安装..."
98
+ $skillAtlas = Get-Command skill-atlas -ErrorAction SilentlyContinue
99
+ if ($skillAtlas) {
100
+ $ver = (skill-atlas --version 2>$null)
101
+ Write-Success "安装成功! 命令: skill-atlas"
102
+ Write-Success "版本: $ver"
103
+ } else {
104
+ Write-Warning "未检测到 skill-atlas 命令,请确认 npm 全局 bin 目录已加入 PATH"
105
+ $npmPrefix = (npm config get prefix 2>$null)
106
+ if ($npmPrefix) {
107
+ Write-Info "请将以下目录加入 PATH: $npmPrefix"
108
+ }
109
+ }
110
+
111
+ Write-Host ""
112
+ Write-Host "╔══════════════════════════════════════════════════════════════╗" -ForegroundColor Cyan
113
+ Write-Host "║ 🎉 安装完成! ║" -ForegroundColor Cyan
114
+ Write-Host "╚══════════════════════════════════════════════════════════════╝" -ForegroundColor Cyan
115
+ Write-Host ""
116
+ Write-Info "快速开始:"
117
+ Write-Host " skill-atlas --help"
118
+ Write-Host " skill-atlas search [skillName]"
119
+ Write-Host " skill-atlas install [skillName]"
120
+ Write-Host ""
121
+
122
+ } catch {
123
+ Write-Error $_.Exception.Message
124
+ exit 1
125
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skill-atlas-cli",
3
- "version": "0.1.30",
3
+ "version": "0.1.31",
4
4
  "description": "skill-atlas CLI - 虾小宝 命令行工具",
5
5
  "homepage": "https://ai.skillatlas.cn/",
6
6
  "type": "module",
@@ -30,6 +30,7 @@
30
30
  "package.json",
31
31
  "README.md",
32
32
  "install.sh",
33
+ "install.ps1",
33
34
  "find-skill.md",
34
35
  "skillhub.md",
35
36
  "agent.md"
package/skillhub.md CHANGED
@@ -16,12 +16,30 @@ which skill-atlas && skill-atlas --version
16
16
 
17
17
  ### 1.2 未安装时自动安装
18
18
 
19
- 如果未安装,执行以下命令:
19
+ **macOS / Linux / Git Bash:**
20
20
 
21
21
  ```bash
22
22
  curl -fsSL https://unpkg.com/skill-atlas-cli/install.sh | bash
23
23
  ```
24
24
 
25
+ **Windows (PowerShell):**
26
+
27
+ ```powershell
28
+ irm https://unpkg.com/skill-atlas-cli/install.ps1 | iex
29
+ ```
30
+
31
+ 或使用完整命令:
32
+
33
+ ```powershell
34
+ Invoke-RestMethod -Uri https://unpkg.com/skill-atlas-cli/install.ps1 | Invoke-Expression
35
+ ```
36
+
37
+ **通用方式(所有平台,需已安装 Node.js):**
38
+
39
+ ```bash
40
+ npm install -g skill-atlas-cli
41
+ ```
42
+
25
43
  安装完成后验证:
26
44
 
27
45
  ```bash