-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ps1
More file actions
82 lines (70 loc) · 2.99 KB
/
install.ps1
File metadata and controls
82 lines (70 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# NeoForge Dev Skill - Installation Script
# Run: irm https://raw.githubusercontent.com/3453890470/opencode-neoforge-skill/main/install.ps1 | iex
param(
[string]$SkillsPath = "$env:USERPROFILE\.config\opencode\skills"
)
$ErrorActionPreference = "Stop"
Write-Host "=== NeoForge Dev Skill Installer ===" -ForegroundColor Cyan
# Create temp directory
$tempDir = Join-Path $env:TEMP "neoforge-skill-$(Get-Random)"
New-Item -ItemType Directory -Force -Path $tempDir | Out-Null
try {
# Download repository
Write-Host "Downloading skill files..." -ForegroundColor Yellow
$repoUrl = "https://github.com/3453890470/opencode-neoforge-skill/archive/refs/heads/main.zip"
$zipPath = Join-Path $tempDir "skill.zip"
Invoke-WebRequest -Uri $repoUrl -OutFile $zipPath
# Extract
Write-Host "Extracting files..." -ForegroundColor Yellow
$extractPath = Join-Path $tempDir "extracted"
Expand-Archive -Path $zipPath -DestinationPath $extractPath -Force
$sourceDir = Join-Path $extractPath "opencode-neoforge-skill-main"
# Create skills directory if not exists
if (-not (Test-Path $SkillsPath)) {
New-Item -ItemType Directory -Force -Path $SkillsPath | Out-Null
Write-Host "Created skills directory: $SkillsPath" -ForegroundColor Green
}
# Copy main skill
Write-Host "Installing main skill..." -ForegroundColor Yellow
$neoforgeDevSource = Join-Path $sourceDir "neoforge-dev"
$neoforgeDest = Join-Path $SkillsPath "neoforge-dev"
if (Test-Path $neoforgeDest) {
Remove-Item -Recurse -Force $neoforgeDest
}
Copy-Item -Recurse -Force $neoforgeDevSource $neoforgeDest
Write-Host " ✓ neoforge-dev" -ForegroundColor Green
# Copy dependency skills
Write-Host "Installing dependency skills..." -ForegroundColor Yellow
$depsSource = Join-Path $sourceDir "dependencies"
if (Test-Path $depsSource) {
Get-ChildItem -Path $depsSource -Directory | ForEach-Object {
$destPath = Join-Path $SkillsPath $_.Name
if (Test-Path $destPath) {
Remove-Item -Recurse -Force $destPath
}
Copy-Item -Recurse -Force $_.FullName $destPath
Write-Host " ✓ $($_.Name)" -ForegroundColor Green
}
}
Write-Host ""
Write-Host "=== Installation Complete ===" -ForegroundColor Green
Write-Host ""
Write-Host "Installed skills:" -ForegroundColor Cyan
Write-Host " • neoforge-dev (main skill)"
Write-Host " • NeoForge开发流程师"
Write-Host " • NeoForge代码师"
Write-Host " • NeoForge质量师"
Write-Host " • NeoForge调试师"
Write-Host " • NeoForge发布师"
Write-Host ""
Write-Host "Next steps:" -ForegroundColor Yellow
Write-Host " 1. Restart OpenCode"
Write-Host " 2. Say: '帮我开发一个 NeoForge mod'"
Write-Host ""
} catch {
Write-Host "Error: $_" -ForegroundColor Red
exit 1
} finally {
# Cleanup
Remove-Item -Recurse -Force $tempDir -ErrorAction SilentlyContinue
}