Add Windows PowerShell installer#25
Conversation
There was a problem hiding this comment.
Code Review
This pull request renames the Claude plugin marketplace from clone-labs to clone-loop, updates the documentation and installation scripts accordingly, and introduces a new Windows PowerShell installer (install.ps1). Feedback on the new PowerShell script suggests avoiding exit and Write-Error to prevent closing the user's terminal window on failure, and executing CommandInfo objects directly rather than using their .Source strings for more robust command execution.
| if (-not $ClaudeCommand) { | ||
| Write-Error "Clone install failed: Claude Code CLI was not found on PATH. Install Claude Code, then rerun this installer." | ||
| exit 1 | ||
| } |
There was a problem hiding this comment.
Using exit in a script executed via Invoke-Expression (iex) or dot-sourcing will terminate the entire PowerShell process, closing the user's terminal window. This is a poor user experience if the CLI is not found.
Additionally, since $ErrorActionPreference = "Stop" is set, calling Write-Error will throw a terminating exception with a noisy stack trace. Using Write-Host with -ForegroundColor Red followed by return provides a much cleaner, user-friendly error message and exits the script gracefully without closing the terminal.
if (-not $ClaudeCommand) {
Write-Host "Clone install failed: Claude Code CLI was not found on PATH. Install Claude Code, then rerun this installer." -ForegroundColor Red
return
}
| $ClaudeBin = $ClaudeCommand.Source | ||
| Write-Host "Installing Clone with $ClaudeBin..." | ||
|
|
||
| & $ClaudeBin plugin marketplace add "$GitHubRepo@main" | ||
| if ($LASTEXITCODE -ne 0) { | ||
| Write-Host "Marketplace add did not complete; refreshing $MarketplaceName if it already exists." | ||
| & $ClaudeBin plugin marketplace update $MarketplaceName | ||
| } | ||
|
|
||
| & $ClaudeBin plugin install $PluginRef --scope user | ||
| if ($LASTEXITCODE -ne 0) { | ||
| Write-Host "Install did not complete; trying plugin update for an existing install." | ||
| & $ClaudeBin plugin update $PluginRef | ||
| } |
There was a problem hiding this comment.
In PowerShell, executing a CommandInfo object directly using the call operator & is more robust than extracting and executing its .Source string. If .Source contains spaces or represents an alias/function, executing it as a raw string can sometimes lead to resolution issues or require extra quoting.
We can execute & $ClaudeCommand directly, and stringify $ClaudeCommand (or use $ClaudeCommand.Source) only when printing the path to the host.
Write-Host "Installing Clone with $($ClaudeCommand.Source)..."
& $ClaudeCommand plugin marketplace add "$GitHubRepo@main"
if ($LASTEXITCODE -ne 0) {
Write-Host "Marketplace add did not complete; refreshing $MarketplaceName if it already exists."
& $ClaudeCommand plugin marketplace update $MarketplaceName
}
& $ClaudeCommand plugin install $PluginRef --scope user
if ($LASTEXITCODE -ne 0) {
Write-Host "Install did not complete; trying plugin update for an existing install."
& $ClaudeCommand plugin update $PluginRef
}
| $PreviousErrorActionPreference = $ErrorActionPreference | ||
| $ErrorActionPreference = "Continue" | ||
| try { | ||
| & $GhCommand.Source repo star $GitHubRepo *> $null |
4baae26 to
5f7aec5
Compare
5f7aec5 to
6a94e5f
Compare
Summary
scripts/install.ps1) so Windows users do not need Git Bash or WSL.clone-loop@clone-loop.clone-labstoclone-loopand keep legacy auth data paths as fallbacks.Windows verification
claude --version->2.1.140 (Claude Code)codex --version->codex-cli 0.128.0claude plugin marketplace add cloneisyou/clone-loop@main-> marketplace presentclaude plugin install clone-loop@clone-loop --scope user-> installed/enabledclaude plugin details clone-loop@clone-loop-> plugin loads with skills/hookscodex plugin marketplace add cloneisyou/clone-loop --ref main-> marketplace present at%USERPROFILE%\.codex\.tmp\marketplaces\clone-looppowershell -NoProfile -ExecutionPolicy Bypass -File scripts\install.ps1-> installer completes on WindowsValidation
bash -n scripts/install.shbash scripts/install.shpowershell -NoProfile -Command ...Parser::ParseFile('scripts/install.ps1')...claude plugin validate .npm testgit diff --check