# cc (copy claude) installer for Windows — https://cc.softwaresoftware.dev # irm https://cc.softwaresoftware.dev/install.ps1 | iex $ErrorActionPreference = 'Stop' $BaseUrl = if ($env:CC_BASE_URL) { $env:CC_BASE_URL } else { 'https://cc.softwaresoftware.dev' } $Dir = if ($env:CC_BIN_DIR) { $env:CC_BIN_DIR } else { Join-Path $env:LOCALAPPDATA 'Programs\cc' } $pyExe = $null foreach ($name in @('python', 'python3', 'py')) { $cmd = Get-Command $name -ErrorAction SilentlyContinue if (-not $cmd) { continue } if ($cmd.Source -like '*WindowsApps*') { continue } # Microsoft Store execution-alias stub try { $v = & $cmd.Source -c 'import sys; print(sys.version_info >= (3, 8))' 2>$null } catch { continue } if ("$v".Trim() -eq 'True') { $pyExe = $cmd.Source; break } } if (-not $pyExe) { Write-Error 'cc: Python 3.8+ is required (winget install Python.Python.3.12), then re-run.'; return } New-Item -ItemType Directory -Force -Path $Dir | Out-Null $script = Join-Path $Dir 'cc.py' Invoke-WebRequest -UseBasicParsing -Uri "$BaseUrl/cc" -OutFile $script $head = (Get-Content $script -TotalCount 5) -join "`n" if ($head -notmatch 'copy claude') { Write-Error 'cc: download looked wrong, aborting'; return } # .cmd shim so `cc` works from cmd.exe and PowerShell. Batch files must be # ASCII (no BOM); if the interpreter path isn't ASCII, rely on PATH instead. $pyRef = if ($pyExe -match '^[\x20-\x7E]+$') { "`"$pyExe`"" } else { (Split-Path $pyExe -Leaf) } $shim = "@echo off`r`n$pyRef `"%~dp0cc.py`" %*`r`n" [IO.File]::WriteAllText((Join-Path $Dir 'cc.cmd'), $shim, [Text.Encoding]::ASCII) [IO.File]::WriteAllText((Join-Path $Dir 'claude-copy.cmd'), $shim, [Text.Encoding]::ASCII) # Add to user PATH if missing $userPath = [Environment]::GetEnvironmentVariable('Path', 'User') if (-not (($userPath -split ';') -contains $Dir)) { [Environment]::SetEnvironmentVariable('Path', "$Dir;$userPath", 'User') $env:Path = "$Dir;$env:Path" Write-Host "cc: added $Dir to your user PATH (open a new terminal for other windows to see it)" } Write-Host "cc: installed to $Dir\cc.cmd (also: claude-copy). Try: cc --help"