-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ps1
More file actions
180 lines (155 loc) Β· 5.53 KB
/
install.ps1
File metadata and controls
180 lines (155 loc) Β· 5.53 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# GudaCC Skills Installer for Windows
# https://github.com/GuDaStudio/skills
param(
[Alias("u")][switch]$User,
[Alias("p")][switch]$Project,
[Alias("t")][string]$Target,
[Alias("a")][switch]$All,
[Alias("s")][string[]]$Skill,
[Alias("l")][switch]$List,
[Alias("h")][switch]$Help
)
$ErrorActionPreference = "Stop"
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$AvailableSkills = @("collaborating-with-codex", "collaborating-with-gemini")
function Write-ColorOutput {
param([string]$Text, [string]$Color = "White")
Write-Host $Text -ForegroundColor $Color
}
function Show-Usage {
Write-ColorOutput "GudaCC Skills Installer" "Blue"
Write-Host ""
Write-Host "Usage: .\install.ps1 [OPTIONS]"
Write-Host ""
Write-Host "Options:"
Write-Host " -User, -u Install to user-level (~\.claude\skills\)"
Write-Host " -Project, -p Install to project-level (.\.claude\skills\)"
Write-Host " -Target, -t <path> Install to custom target path"
Write-Host " -All, -a Install all available skills"
Write-Host " -Skill, -s <name> Install specific skill (can be used multiple times)"
Write-Host " -List, -l List available skills"
Write-Host " -Help, -h Show this help message"
Write-Host ""
Write-Host "Examples:"
Write-Host " .\install.ps1 -User -All"
Write-Host " .\install.ps1 -Project -All"
Write-Host " .\install.ps1 -User -Skill collaborating-with-codex"
Write-Host " .\install.ps1 -User -Skill collaborating-with-codex -Skill collaborating-with-gemini"
Write-Host " .\install.ps1 -Target C:\custom\path -All"
Write-Host ""
Write-Host "Available skills:"
foreach ($s in $AvailableSkills) {
Write-Host " - $s"
}
}
function Show-SkillList {
Write-ColorOutput "Available Skills:" "Blue"
Write-Host ""
foreach ($s in $AvailableSkills) {
$sourcePath = Join-Path $ScriptDir $s
if (Test-Path $sourcePath -PathType Container) {
Write-Host " " -NoNewline
Write-ColorOutput "β" "Green" -NoNewline
Write-Host " $s"
} else {
Write-Host " " -NoNewline
Write-ColorOutput "β" "Red" -NoNewline
Write-Host " $s (not found in source)"
}
}
}
function Write-ColorOutput {
param(
[string]$Text,
[string]$Color = "White",
[switch]$NoNewline
)
if ($NoNewline) {
Write-Host $Text -ForegroundColor $Color -NoNewline
} else {
Write-Host $Text -ForegroundColor $Color
}
}
function Install-Skill {
param([string]$SkillName, [string]$TargetDir)
$sourceDir = Join-Path $ScriptDir $SkillName
$destDir = Join-Path $TargetDir $SkillName
if (-not (Test-Path $sourceDir -PathType Container)) {
Write-ColorOutput "Error: Skill '$SkillName' not found in source directory" "Red"
return $false
}
Write-Host "Installing " -NoNewline
Write-ColorOutput "$SkillName" "Cyan" -NoNewline
Write-Host " -> $destDir"
if (-not (Test-Path $TargetDir)) {
New-Item -ItemType Directory -Path $TargetDir -Force | Out-Null
}
if (Test-Path $destDir) {
Write-ColorOutput " Removing existing installation..." "Yellow"
Remove-Item -Path $destDir -Recurse -Force
}
Copy-Item -Path $sourceDir -Destination $destDir -Recurse
$gitFile = Join-Path $destDir ".git"
if (Test-Path $gitFile -PathType Leaf) {
Remove-Item -Path $gitFile -Force
}
Write-ColorOutput " β Installed" "Green"
return $true
}
if ($Help) {
Show-Usage
exit 0
}
if ($List) {
Show-SkillList
exit 0
}
$TargetPath = ""
if ($User) {
$TargetPath = Join-Path $env:USERPROFILE ".claude\skills"
} elseif ($Project) {
$TargetPath = ".\.claude\skills"
} elseif ($Target) {
$TargetPath = $Target
}
if (-not $TargetPath) {
Write-ColorOutput "Error: Please specify installation target (-User, -Project, or -Target)" "Red"
Write-Host ""
Show-Usage
exit 1
}
if (-not $All -and (-not $Skill -or $Skill.Count -eq 0)) {
Write-ColorOutput "Error: Please specify skills to install (-All or -Skill)" "Red"
Write-Host ""
Show-Usage
exit 1
}
$SkillsToInstall = @()
if ($All) {
$SkillsToInstall = $AvailableSkills
} else {
$SkillsToInstall = $Skill
}
foreach ($s in $SkillsToInstall) {
if ($s -notin $AvailableSkills) {
Write-ColorOutput "Error: Unknown skill '$s'" "Red"
Write-Host "Available skills: $($AvailableSkills -join ', ')"
exit 1
}
}
Write-ColorOutput "ββββββββββββββββββββββββββββββββββββββββ" "Blue"
Write-ColorOutput "GudaCC Skills Installer" "Blue"
Write-ColorOutput "ββββββββββββββββββββββββββββββββββββββββ" "Blue"
Write-Host ""
Write-Host "Target: " -NoNewline
Write-ColorOutput $TargetPath "Green"
Write-Host "Skills: " -NoNewline
Write-ColorOutput ($SkillsToInstall -join ", ") "Green"
Write-Host ""
foreach ($s in $SkillsToInstall) {
Install-Skill -SkillName $s -TargetDir $TargetPath
}
Write-Host ""
Write-ColorOutput "ββββββββββββββββββββββββββββββββββββββββ" "Green"
Write-ColorOutput "Installation complete!" "Green"
Write-ColorOutput "ββββββββββββββββββββββββββββββββββββββββ" "Green"