-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcc_setup_win.ps1
More file actions
executable file
·673 lines (532 loc) · 19.4 KB
/
Copy pathcc_setup_win.ps1
File metadata and controls
executable file
·673 lines (532 loc) · 19.4 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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
$ErrorActionPreference = "Stop"
$RepoUrl = "https://github.com/NanmiCoder/cc-haha"
$RepoUrlFast = "https://ghfast.top/https://github.com/NanmiCoder/cc-haha"
$EnvUrl = "https://raw.githubusercontent.com/huluxiaohuowa/cc_setup/main/.env"
$EnvUrlFast = "https://ghfast.top/" + $EnvUrl
$GhfastPrefix = if ($env:GHFAST_PREFIX) { $env:GHFAST_PREFIX.TrimEnd("/") + "/" } else { "https://ghfast.top/" }
$RtkInstallUrls = @(
"https://raw.githubusercontent.com/rtk-ai/rtk/master/install.sh",
"https://raw.githubusercontent.com/rtk-ai/rtk/main/install.sh"
)
$RtkDir = Join-Path $HOME ".local\rtk"
$RtkBinDir = Join-Path $RtkDir "bin"
$DefaultDir = Join-Path $HOME "cc-haha"
function Log {
param([string]$Message)
Write-Host "[INFO] $Message" -ForegroundColor Green
}
function Warn {
param([string]$Message)
Write-Host "[WARN] $Message" -ForegroundColor Yellow
}
function Die {
param([string]$Message)
Write-Host "[ERR] $Message" -ForegroundColor Red
exit 1
}
function Test-Cmd {
param([string]$Name)
return [bool](Get-Command $Name -ErrorAction SilentlyContinue)
}
function Normalize-PathText {
param([string]$Path)
if ([string]::IsNullOrWhiteSpace($Path)) {
return ""
}
return $Path.Trim().TrimEnd([char]'\', [char]'/')
}
function Convert-ToGitBashPath {
param([string]$WindowsPath)
$full = [System.IO.Path]::GetFullPath($WindowsPath)
$drive = $full.Substring(0, 1).ToLower()
$rest = $full.Substring(2).Replace("\", "/")
return "/$drive$rest"
}
function Find-GitBash {
$gitCmd = Get-Command git.exe -ErrorAction SilentlyContinue
if ($gitCmd) {
$gitDir = Split-Path -Parent $gitCmd.Source
$bashSameDir = Join-Path $gitDir "bash.exe"
if (Test-Path $bashSameDir) {
return $bashSameDir
}
$gitRoot = Split-Path -Parent $gitDir
$bashFromRoot = Join-Path $gitRoot "bin\bash.exe"
if (Test-Path $bashFromRoot) {
return $bashFromRoot
}
}
$bashCmd = Get-Command bash.exe -ErrorAction SilentlyContinue
if ($bashCmd) {
return $bashCmd.Source
}
$candidates = @(
"C:\dev\apps\git\bin\bash.exe",
"C:\Program Files\Git\bin\bash.exe",
"C:\Program Files (x86)\Git\bin\bash.exe"
)
foreach ($c in $candidates) {
if (Test-Path $c) {
return $c
}
}
return $null
}
function Download-NonEmpty {
param(
[string]$Primary,
[string]$Fallback,
[string]$Output
)
if (Test-Path $Output) {
Remove-Item -Force $Output
}
try {
Invoke-WebRequest -Uri $Primary -OutFile $Output -UseBasicParsing -TimeoutSec 60
} catch {
Warn "主地址下载失败,尝试备用地址:$Fallback"
}
if ((Test-Path $Output) -and ((Get-Item $Output).Length -gt 0)) {
return
}
if (Test-Path $Output) {
Remove-Item -Force $Output
}
Invoke-WebRequest -Uri $Fallback -OutFile $Output -UseBasicParsing -TimeoutSec 60
if (!(Test-Path $Output) -or ((Get-Item $Output).Length -le 0)) {
Die "下载失败,主地址和备用地址都不可用。"
}
}
function Download-RtkInstall {
param([string]$Output)
foreach ($url in $RtkInstallUrls) {
$fastUrl = $GhfastPrefix + $url
if (Test-Path $Output) {
Remove-Item -Force $Output
}
try {
Invoke-WebRequest -Uri $url -OutFile $Output -UseBasicParsing -TimeoutSec 60
} catch {
Warn "RTK install.sh 直连失败,尝试 ghfast:$fastUrl"
}
if ((Test-Path $Output) -and ((Get-Item $Output).Length -gt 0)) {
return
}
if (Test-Path $Output) {
Remove-Item -Force $Output
}
try {
Invoke-WebRequest -Uri $fastUrl -OutFile $Output -UseBasicParsing -TimeoutSec 60
} catch {
Warn "RTK install.sh ghfast 下载失败,尝试下一个分支。"
}
if ((Test-Path $Output) -and ((Get-Item $Output).Length -gt 0)) {
return
}
}
Die "RTK install.sh 下载失败。"
}
function Remove-UserPath {
param([string]$Dir)
$current = [Environment]::GetEnvironmentVariable("Path", "User")
if ([string]::IsNullOrWhiteSpace($current)) {
return
}
$targetNorm = Normalize-PathText $Dir
$parts = New-Object System.Collections.Generic.List[string]
foreach ($item in ($current -split ";")) {
if ([string]::IsNullOrWhiteSpace($item)) {
continue
}
if ((Normalize-PathText $item) -ine $targetNorm) {
[void]$parts.Add($item)
}
}
[Environment]::SetEnvironmentVariable("Path", ($parts -join ";"), "User")
}
function Add-UserPathFirst {
param([string]$Dir)
$current = [Environment]::GetEnvironmentVariable("Path", "User")
if ([string]::IsNullOrWhiteSpace($current)) {
$current = ""
}
$targetNorm = Normalize-PathText $Dir
$parts = New-Object System.Collections.Generic.List[string]
foreach ($item in ($current -split ";")) {
if ([string]::IsNullOrWhiteSpace($item)) {
continue
}
if ((Normalize-PathText $item) -ine $targetNorm) {
[void]$parts.Add($item)
}
}
$newPath = $Dir
if ($parts.Count -gt 0) {
$newPath = "$Dir;" + ($parts -join ";")
}
[Environment]::SetEnvironmentVariable("Path", $newPath, "User")
$envParts = New-Object System.Collections.Generic.List[string]
foreach ($item in ($env:Path -split ";")) {
if ([string]::IsNullOrWhiteSpace($item)) {
continue
}
if ((Normalize-PathText $item) -ine $targetNorm) {
[void]$envParts.Add($item)
}
}
$env:Path = "$Dir;" + ($envParts -join ";")
}
function Install-BasicTools-IfNeeded {
if (!(Test-Cmd "git")) {
if (Test-Cmd "winget") {
Log "未检测到 git,尝试通过 winget 安装 Git..."
winget install --id Git.Git -e --source winget
} else {
Die "未检测到 git,也未检测到 winget。请先安装 Git for Windows。"
}
}
if (!(Test-Cmd "curl")) {
Warn "未检测到 curl。Windows 11 通常内置 curl;如后续下载失败,请检查系统环境。"
}
}
function Install-Bun-IfNeeded {
if (Test-Cmd "bun") {
Log "bun 已存在:$(bun --version)"
return
}
Log "未检测到 bun,开始安装 bun..."
powershell -NoProfile -ExecutionPolicy Bypass -Command "irm bun.sh/install.ps1 | iex"
$bunBin = Join-Path $HOME ".bun\bin"
Add-UserPathFirst $bunBin
if (!(Test-Cmd "bun")) {
Die "bun 安装后仍不可用。请重新打开 PowerShell,或检查 $bunBin 是否在 PATH 中。"
}
Log "bun 安装完成:$(bun --version)"
}
function Configure-Bun-Mirror {
$bunfig = Join-Path $HOME ".bunfig.toml"
if (!(Test-Path $bunfig)) {
New-Item -ItemType File -Path $bunfig -Force | Out-Null
}
$text = ""
try {
$text = Get-Content $bunfig -Raw -ErrorAction SilentlyContinue
} catch {
$text = ""
}
if ($text -notmatch 'registry\s*=\s*"https://registry\.npmmirror\.com"') {
Add-Content -Path $bunfig -Value @"
[install]
registry = "https://registry.npmmirror.com"
"@
}
Log "已配置 bun registry。"
}
function Clone-Or-Update-Repo {
param([string]$Target)
if (Test-Path (Join-Path $Target ".git")) {
Log "目标目录已存在,执行 git pull:$Target"
try {
git -C $Target pull --ff-only
} catch {
Warn "git pull 失败,继续使用现有目录。"
}
return
}
if (Test-Path $Target) {
Die "目标路径已存在但不是 git 仓库:$Target"
}
Log "开始克隆 cc-haha 到:$Target"
try {
git clone $RepoUrl $Target
return
} catch {
Warn "GitHub 直连失败,尝试 ghfast:$RepoUrlFast"
}
git clone $RepoUrlFast $Target
}
function Replace-EnvFile {
param([string]$Target)
$tmp = [System.IO.Path]::GetTempFileName()
try {
Log "下载 .env 配置文件..."
Download-NonEmpty -Primary $EnvUrl -Fallback $EnvUrlFast -Output $tmp
$envFile = Join-Path $Target ".env"
if (Test-Path $envFile) {
$ts = Get-Date -Format "yyyyMMdd_HHmmss"
Copy-Item $envFile "$envFile.bak.$ts" -Force
Warn "原 .env 已备份:$envFile.bak.$ts"
}
Move-Item $tmp $envFile -Force
Log ".env 已写入:$envFile"
} finally {
Remove-Item $tmp -Force -ErrorAction SilentlyContinue
}
}
function Install-Deps {
param([string]$Target)
Push-Location $Target
try {
if (!(Test-Path "package.json")) {
Die "未找到 package.json,目录不是 cc-haha 仓库:$Target"
}
Log "执行 bun install..."
bun install
} finally {
Pop-Location
}
}
function Write-OnboardingConfig {
# repaired config marker CLAUDE_CODE_ATTRIBUTION_HEADERS
$p = Join-Path $HOME ".claude.json"
$data = [ordered]@{}
if (Test-Path $p) {
try {
$json = Get-Content $p -Raw | ConvertFrom-Json
foreach ($prop in $json.PSObject.Properties) {
$data[$prop.Name] = $prop.Value
}
} catch {
$data = [ordered]@{}
}
}
$data["hasCompletedOnboarding"] = $true
$data["hasAcceptedTerms"] = $true
$data["hasSeenIdeIntegrationNudge"] = $true
$data["hasCompletedProjectOnboarding"] = $true
$data["disableAllTelemetry"] = $true
$data | ConvertTo-Json -Depth 10 | Set-Content -Path $p -Encoding UTF8
Log "已写入 $p"
}
function Ensure-ClaudeAgentWorkRules {
$claudeDir = Join-Path $HOME ".claude"
$claudeMd = Join-Path $claudeDir "CLAUDE.md"
New-Item -ItemType Directory -Path $claudeDir -Force | Out-Null
$needsFix = $false
if (!(Test-Path $claudeMd)) {
$needsFix = $true
} else {
$text = Get-Content $claudeMd -Raw -ErrorAction SilentlyContinue
if ($text -notmatch '(?m)^@RTK\.md$' -or
$text -notmatch 'Use tools first\.' -or
$text -notmatch 'If a response claims to check, read, inspect, list, or verify something') {
$needsFix = $true
}
}
if (-not $needsFix) {
Log "~/.claude/CLAUDE.md agent work rules 已就绪。"
return
}
if (Test-Path $claudeMd) {
$stamp = Get-Date -Format "yyyyMMddHHmmss"
Copy-Item $claudeMd "$claudeMd.bak.$stamp" -Force -ErrorAction SilentlyContinue
}
$content = @'
@RTK.md
# Agent Work Rules
When the user asks about files, repositories, code, configuration, shell commands, or project status:
- Use tools first.
- Do not answer from assumptions.
- For direct shell commands like `ls`, `pwd`, `cat`, `grep`, `find`, execute them directly.
- For repository analysis, inspect files before answering.
- If a response claims to check, read, inspect, list, or verify something, it must call the appropriate tool first.
'@
Set-Content -Path $claudeMd -Value $content -Encoding UTF8
Log "已修复 ~/.claude/CLAUDE.md agent work rules。"
}
function Ensure-Rtk {
New-Item -ItemType Directory -Path $RtkBinDir -Force | Out-Null
Add-UserPathFirst $RtkBinDir
$rtkExe = Join-Path $RtkBinDir "rtk.exe"
$ok = $false
if (Test-Path $rtkExe) {
try {
& $rtkExe --version *> $null
if ($LASTEXITCODE -eq 0) { $ok = $true }
} catch { $ok = $false }
}
$cmd = Get-Command rtk.exe -ErrorAction SilentlyContinue
if (-not $ok -and $cmd) {
try {
& $cmd.Source --version *> $null
if ($LASTEXITCODE -eq 0) {
Copy-Item $cmd.Source $rtkExe -Force
$ok = $true
}
} catch { $ok = $false }
}
if (-not $ok) {
Log "安装/修复 RTK:$rtkExe"
$tmp = Join-Path ([System.IO.Path]::GetTempPath()) ("rtk-install-" + [guid]::NewGuid().ToString())
New-Item -ItemType Directory -Path $tmp -Force | Out-Null
try {
$install = Join-Path $tmp "install.sh"
Download-RtkInstall $install
if (!(Test-Path $install) -or ((Get-Item $install).Length -le 0)) { Die "RTK install.sh 下载失败。" }
$txt = Get-Content $install -Raw
$txt = $txt.Replace('https://github.com', ($GhfastPrefix + 'https://github.com'))
$txt = $txt.Replace('https://raw.githubusercontent.com', ($GhfastPrefix + 'https://raw.githubusercontent.com'))
Set-Content -Path $install -Value $txt -Encoding UTF8
$bash = Find-GitBash
if (-not $bash -or !(Test-Path $bash)) { Die "找不到 Git Bash,无法执行 RTK install.sh。" }
$rtkBashBin = Convert-ToGitBashPath $RtkBinDir
$installBash = Convert-ToGitBashPath $install
& $bash -lc "mkdir -p '$rtkBashBin' && RTK_INSTALL_DIR='$rtkBashBin' RTK_BIN_DIR='$rtkBashBin' bash '$installBash'"
if ($LASTEXITCODE -ne 0) { Warn "RTK install.sh 执行失败,尝试从 release 直接下载。" }
} finally {
Remove-Item $tmp -Recurse -Force -ErrorAction SilentlyContinue
}
}
$cmd = Get-Command rtk.exe -ErrorAction SilentlyContinue
if ($cmd -and (!(Test-Path $rtkExe))) { Copy-Item $cmd.Source $rtkExe -Force -ErrorAction SilentlyContinue }
if (!(Test-Path $rtkExe)) {
Warn "未找到 $rtkExe;如果 RTK installer 安装到了其他目录,请确认 rtk.exe 在 PATH 中。"
}
$rtkCmd = Get-Command rtk.exe -ErrorAction SilentlyContinue
if (-not $rtkCmd) { $rtkCmd = Get-Command rtk -ErrorAction SilentlyContinue }
if (-not $rtkCmd) { Die "RTK 安装后仍不可用。" }
try { & $rtkCmd.Source --version | Out-Host } catch { Warn "rtk --version 执行异常。" }
try { "y" | & $rtkCmd.Source init -g | Out-Host } catch { Warn "rtk init -g 执行失败,但 rtk 已安装。" }
try { Ensure-ClaudeAgentWorkRules } catch { Warn "修复 ~/.claude/CLAUDE.md 失败,请手动检查。" }
}
function Write-ClaudeCommands {
param([string]$Target)
$binPath = Join-Path $Target "bin"
New-Item -ItemType Directory -Path $binPath -Force | Out-Null
$entry = Join-Path $binPath "claude-haha"
if (!(Test-Path $entry)) {
Die "找不到原仓库入口:$entry"
}
$bash = Find-GitBash
if (-not $bash -or !(Test-Path $bash)) {
Die "找不到 Git Bash。请确认 git.exe 同目录下有 bash.exe,或 bash.exe 在 PATH 中。"
}
$installBashRoot = Convert-ToGitBashPath $Target
$entryBashPath = "$installBashRoot/bin/claude-haha"
Remove-Item (Join-Path $binPath "claude") -Force -ErrorAction SilentlyContinue
Set-Content -Path (Join-Path $binPath "claude.ps1") -Encoding UTF8 -Value @"
`$ErrorActionPreference = "Stop"
`$bash = "$bash"
`$entryBashPath = "$entryBashPath"
function Convert-ToGitBashPathLocal {
param([string]`$WindowsPath)
`$full = [System.IO.Path]::GetFullPath(`$WindowsPath)
`$drive = `$full.Substring(0, 1).ToLower()
`$rest = `$full.Substring(2).Replace("\", "/")
return "/`$drive`$rest"
}
function Quote-BashArg {
param([string]`$Value)
if (`$null -eq `$Value) {
return "''"
}
return "'" + (`$Value -replace "'", "'\''") + "'"
}
`$caller = Convert-ToGitBashPathLocal (Get-Location).Path
`$quotedArgs = New-Object System.Collections.Generic.List[string]
foreach (`$a in `$args) {
[void]`$quotedArgs.Add((Quote-BashArg `$a))
}
`$argText = `$quotedArgs -join " "
`$cmd = "cd " + (Quote-BashArg `$caller) + " && bash " + (Quote-BashArg `$entryBashPath) + " " + `$argText
& `$bash -lc `$cmd
exit `$LASTEXITCODE
"@
Set-Content -Path (Join-Path $binPath "claude.cmd") -Encoding ASCII -Value @"
@echo off
setlocal
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0claude.ps1" %*
"@
Set-Content -Path (Join-Path $binPath "claude-env.cmd") -Encoding ASCII -Value @"
@echo off
setlocal
set "ENV_FILE=$Target\.env"
where code >nul 2>nul
if %errorlevel%==0 (
code "%ENV_FILE%"
) else (
notepad "%ENV_FILE%"
)
"@
Set-Content -Path (Join-Path $binPath "claude-update.cmd") -Encoding ASCII -Value @"
@echo off
setlocal
"$bash" -lc "cd '$installBashRoot' && git pull --ff-only && bun install && rm -f ./bin/claude"
powershell -NoProfile -ExecutionPolicy Bypass -Command "Remove-Item -LiteralPath '$binPath\claude' -Force -ErrorAction SilentlyContinue"
powershell -NoProfile -ExecutionPolicy Bypass -Command "`$env:GHFAST_PREFIX='${env:GHFAST_PREFIX}'; `$p=Join-Path "$HOME" ".local\rtk\bin"; [Environment]::SetEnvironmentVariable("Path", `$p+";"+[Environment]::GetEnvironmentVariable("Path","User"), "User")"
echo updated
"@
Set-Content -Path (Join-Path $binPath "claude-uninstall.ps1") -Encoding UTF8 -Value @"
`$ErrorActionPreference = "SilentlyContinue"
`$installDir = "$Target"
`$binDir = "$binPath"
Set-Location `$env:USERPROFILE
`$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
if (`$userPath) {
`$parts = New-Object System.Collections.Generic.List[string]
foreach (`$item in (`$userPath -split ";")) {
if ([string]::IsNullOrWhiteSpace(`$item)) {
continue
}
if (`$item.Trim().TrimEnd([char]'\', [char]'/') -ine `$binDir.Trim().TrimEnd([char]'\', [char]'/')) {
[void]`$parts.Add(`$item)
}
}
[Environment]::SetEnvironmentVariable("Path", (`$parts -join ";"), "User")
}
Remove-Item -LiteralPath `$installDir -Recurse -Force
Write-Host "done"
"@
Set-Content -Path (Join-Path $binPath "claude-uninstall.cmd") -Encoding ASCII -Value @"
@echo off
setlocal
echo Removing $Target
cd /d "%USERPROFILE%"
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0claude-uninstall.ps1"
"@
Log "已生成命令:$binPath\claude.cmd"
Log "已生成 PowerShell 启动器:$binPath\claude.ps1"
Log "已生成卸载器:$binPath\claude-uninstall.cmd"
Log "Git Bash:$bash"
Log "cc-haha 入口:$entryBashPath"
Log "调用 claude 时会保留当前目录。"
}
function Main {
Write-Host "请输入 cc-haha 创建位置,直接回车默认:$DefaultDir"
$installDir = Read-Host ">"
if ([string]::IsNullOrWhiteSpace($installDir)) {
$installDir = $DefaultDir
}
$installDir = $installDir.Replace("~", $HOME)
$installDir = [System.IO.Path]::GetFullPath($installDir)
Log "安装目录:$installDir"
Install-BasicTools-IfNeeded
Install-Bun-IfNeeded
Configure-Bun-Mirror
Clone-Or-Update-Repo $installDir
Replace-EnvFile $installDir
Install-Deps $installDir
Write-OnboardingConfig
Write-ClaudeCommands $installDir
$binPath = Join-Path $installDir "bin"
Add-UserPathFirst $binPath
Ensure-Rtk
Write-Host ""
Log "安装完成。"
Write-Host ""
Write-Host "当前窗口已更新 PATH。测试命令:"
Write-Host " where.exe claude"
Write-Host " type `"$binPath\claude.cmd`""
Write-Host " type `"$binPath\claude.ps1`""
Write-Host " claude"
Write-Host " claude-env"
Write-Host " claude-update"
Write-Host " claude-uninstall"
Write-Host ""
Warn "Windows 下使用 claude,不要使用 claude-haha。原仓库 bin\claude-haha 是 bash 脚本。"
Warn "如果 where.exe claude 仍显示旧路径,请重新打开 PowerShell。"
}
Main
@huluxiaohuowa
Comment
# added marker CLAUDE_CODE_ATTRIBUTION_HEADERS