install.ps1 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. # claude-mods installer for Windows
  2. # Creates symlinks to Claude Code directories (requires admin or developer mode)
  3. $ErrorActionPreference = "Stop"
  4. $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
  5. $ClaudeDir = Join-Path $env:USERPROFILE ".claude"
  6. Write-Host "Installing claude-mods..." -ForegroundColor Cyan
  7. Write-Host "Source: $ScriptDir"
  8. Write-Host "Target: $ClaudeDir"
  9. Write-Host ""
  10. # Create Claude directories if they don't exist
  11. $dirs = @("commands", "skills", "agents")
  12. foreach ($dir in $dirs) {
  13. $path = Join-Path $ClaudeDir $dir
  14. if (!(Test-Path $path)) {
  15. New-Item -ItemType Directory -Path $path -Force | Out-Null
  16. }
  17. }
  18. # Install commands
  19. Write-Host "Installing commands..." -ForegroundColor Yellow
  20. $commandsDir = Join-Path $ScriptDir "commands"
  21. if (Test-Path $commandsDir) {
  22. Get-ChildItem -Path $commandsDir -Directory | ForEach-Object {
  23. $cmdName = $_.Name
  24. $cmdFile = Join-Path $_.FullName "$cmdName.md"
  25. if (Test-Path $cmdFile) {
  26. $target = Join-Path $ClaudeDir "commands\$cmdName.md"
  27. if (Test-Path $target) {
  28. Write-Host " Updating: $cmdName.md"
  29. Remove-Item $target -Force
  30. } else {
  31. Write-Host " Installing: $cmdName.md"
  32. }
  33. # Try symlink first, fall back to copy
  34. try {
  35. New-Item -ItemType SymbolicLink -Path $target -Target $cmdFile -Force | Out-Null
  36. } catch {
  37. Copy-Item $cmdFile $target -Force
  38. Write-Host " (copied - enable Developer Mode for symlinks)" -ForegroundColor DarkGray
  39. }
  40. }
  41. }
  42. }
  43. # Install skills
  44. Write-Host "Installing skills..." -ForegroundColor Yellow
  45. $skillsDir = Join-Path $ScriptDir "skills"
  46. if (Test-Path $skillsDir) {
  47. Get-ChildItem -Path $skillsDir -Directory | ForEach-Object {
  48. $skillName = $_.Name
  49. $target = Join-Path $ClaudeDir "skills\$skillName"
  50. if (Test-Path $target) {
  51. Write-Host " Updating: $skillName"
  52. Remove-Item $target -Recurse -Force
  53. } else {
  54. Write-Host " Installing: $skillName"
  55. }
  56. # Try symlink first, fall back to copy
  57. try {
  58. New-Item -ItemType SymbolicLink -Path $target -Target $_.FullName -Force | Out-Null
  59. } catch {
  60. Copy-Item $_.FullName $target -Recurse -Force
  61. Write-Host " (copied - enable Developer Mode for symlinks)" -ForegroundColor DarkGray
  62. }
  63. }
  64. }
  65. # Install agents
  66. Write-Host "Installing agents..." -ForegroundColor Yellow
  67. $agentsDir = Join-Path $ScriptDir "agents"
  68. if (Test-Path $agentsDir) {
  69. Get-ChildItem -Path $agentsDir -Filter "*.md" | ForEach-Object {
  70. $agentName = $_.Name
  71. $target = Join-Path $ClaudeDir "agents\$agentName"
  72. if (Test-Path $target) {
  73. Write-Host " Updating: $agentName"
  74. Remove-Item $target -Force
  75. } else {
  76. Write-Host " Installing: $agentName"
  77. }
  78. # Try symlink first, fall back to copy
  79. try {
  80. New-Item -ItemType SymbolicLink -Path $target -Target $_.FullName -Force | Out-Null
  81. } catch {
  82. Copy-Item $_.FullName $target -Force
  83. Write-Host " (copied - enable Developer Mode for symlinks)" -ForegroundColor DarkGray
  84. }
  85. }
  86. }
  87. Write-Host ""
  88. Write-Host "Installation complete!" -ForegroundColor Green
  89. Write-Host ""
  90. Write-Host "Installed to:"
  91. Write-Host " Commands: $ClaudeDir\commands\"
  92. Write-Host " Skills: $ClaudeDir\skills\"
  93. Write-Host " Agents: $ClaudeDir\agents\"