diff --git a/README.md b/README.md index 4f934167..4f80f618 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,6 @@ ### **🚀 Quick One-Line Installation** -#### **Install Latest Stable Release (Recommended)** - **Windows (PowerShell):** ```powershell Invoke-Expression (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.ps1" -UseBasicParsing).Content @@ -51,31 +49,10 @@ Invoke-Expression (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/cat bash <(curl -fsSL https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.sh) ``` -#### **Install Latest Development Version** - -**Windows (PowerShell):** -```powershell -$script = (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.ps1" -UseBasicParsing).Content -[ScriptBlock]::Create($script).Invoke('-Version', 'latest') -``` - -**Linux/macOS (Bash/Zsh):** -```bash -bash <(curl -fsSL https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.sh) --version latest -``` - -#### **Install Specific Version** - -**Windows (PowerShell):** -```powershell -$script = (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.ps1" -UseBasicParsing).Content -[ScriptBlock]::Create($script).Invoke('-Version', 'stable', '-Tag', 'v3.2.0') -``` - -**Linux/macOS (Bash/Zsh):** -```bash -bash <(curl -fsSL https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.sh) --version stable --tag v3.2.0 -``` +> 💡 **Version Selection**: During installation, you'll be presented with an interactive menu to choose: +> - **Latest Stable Release** (Recommended) - Production-ready version +> - **Latest Development Version** - Cutting-edge features +> - **Specific Release Version** - Install a specific tagged release (e.g., v3.2.0) ### **✅ Verify Installation** After installation, run the following command to ensure CCW is working: diff --git a/README_CN.md b/README_CN.md index 837d31e9..41a77bc5 100644 --- a/README_CN.md +++ b/README_CN.md @@ -39,8 +39,6 @@ ### **🚀 一键快速安装** -#### **安装最新稳定版(推荐)** - **Windows (PowerShell):** ```powershell Invoke-Expression (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.ps1" -UseBasicParsing).Content @@ -51,31 +49,10 @@ Invoke-Expression (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/cat bash <(curl -fsSL https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.sh) ``` -#### **安装最新开发版** - -**Windows (PowerShell):** -```powershell -$script = (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.ps1" -UseBasicParsing).Content -[ScriptBlock]::Create($script).Invoke('-Version', 'latest') -``` - -**Linux/macOS (Bash/Zsh):** -```bash -bash <(curl -fsSL https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.sh) --version latest -``` - -#### **安装指定版本** - -**Windows (PowerShell):** -```powershell -$script = (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.ps1" -UseBasicParsing).Content -[ScriptBlock]::Create($script).Invoke('-Version', 'stable', '-Tag', 'v3.2.0') -``` - -**Linux/macOS (Bash/Zsh):** -```bash -bash <(curl -fsSL https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.sh) --version stable --tag v3.2.0 -``` +> 💡 **版本选择**:安装过程中会显示交互式菜单,您可以选择: +> - **最新稳定版**(推荐)- 生产就绪版本 +> - **最新开发版** - 最新功能 +> - **指定版本** - 安装特定标签版本(例如 v3.2.0) ### **✅ 验证安装** 安装后,运行以下命令以确保 CCW 正常工作: diff --git a/install-remote.ps1 b/install-remote.ps1 index 41eb35de..7568cd9d 100644 --- a/install-remote.ps1 +++ b/install-remote.ps1 @@ -338,18 +338,100 @@ function Wait-ForUserConfirmation { } } +function Show-VersionMenu { + Write-Host "" + Write-ColorOutput "====== Version Selection ======" $ColorInfo + Write-Host "1) Latest Stable Release (Recommended)" + Write-Host " - Production-ready version" + Write-Host " - Auto-detected from GitHub releases" + Write-Host "" + Write-Host "2) Latest Development Version" + Write-Host " - Cutting-edge features" + Write-Host " - May contain experimental changes" + Write-Host "" + Write-Host "3) Specific Release Version" + Write-Host " - Install a specific tagged release" + Write-Host " - You will be asked for the version tag" + Write-Host "" + Write-ColorOutput "===============================" $ColorInfo + Write-Host "" +} + +function Get-UserVersionChoice { + if ($NonInteractive -or $Force) { + # Non-interactive mode: use default stable version + return @{ + Type = "stable" + Tag = $Tag + Branch = $Branch + } + } + + Show-VersionMenu + + $choice = Read-Host "Select version to install (1-3, default: 1)" + + switch ($choice) { + "2" { + Write-ColorOutput "Selected: Latest Development Version" $ColorSuccess + return @{ + Type = "latest" + Tag = "" + Branch = "main" + } + } + "3" { + Write-Host "" + Write-ColorOutput "Available recent releases:" $ColorInfo + Write-Host " v3.2.0, v3.1.0, v3.0.1, v3.0.0" + Write-Host "" + $tagInput = Read-Host "Enter version tag (e.g., v3.2.0)" + + if ([string]::IsNullOrWhiteSpace($tagInput)) { + Write-ColorOutput "No tag specified, using latest stable" $ColorWarning + return @{ + Type = "stable" + Tag = "" + Branch = "main" + } + } + + Write-ColorOutput "Selected: Specific Version $tagInput" $ColorSuccess + return @{ + Type = "stable" + Tag = $tagInput + Branch = "main" + } + } + default { + Write-ColorOutput "Selected: Latest Stable Release (default)" $ColorSuccess + return @{ + Type = "stable" + Tag = "" + Branch = "main" + } + } + } +} + function Main { Show-Header - + Write-ColorOutput "This will download and install Claude Code Workflow System from GitHub." $ColorInfo Write-Host "" - + # Test prerequisites Write-ColorOutput "Checking system requirements..." $ColorInfo if (-not (Test-Prerequisites)) { Wait-ForUserConfirmation "System check failed! Press any key to exit..." -ExitAfter } - + + # Get version choice from user (interactive menu) + $versionChoice = Get-UserVersionChoice + $script:Version = $versionChoice.Type + $script:Tag = $versionChoice.Tag + $script:Branch = $versionChoice.Branch + # Determine version information for display $versionInfo = switch ($Version) { "stable" { diff --git a/install-remote.sh b/install-remote.sh index e9ae64ac..0a00ccba 100644 --- a/install-remote.sh +++ b/install-remote.sh @@ -382,6 +382,70 @@ Repository: https://github.com/catlog22/Claude-Code-Workflow EOF } +function show_version_menu() { + echo "" + write_color "====== Version Selection ======" "$COLOR_INFO" + echo "1) Latest Stable Release (Recommended)" + echo " - Production-ready version" + echo " - Auto-detected from GitHub releases" + echo "" + echo "2) Latest Development Version" + echo " - Cutting-edge features" + echo " - May contain experimental changes" + echo "" + echo "3) Specific Release Version" + echo " - Install a specific tagged release" + echo " - You will be asked for the version tag" + echo "" + write_color "===============================" "$COLOR_INFO" + echo "" +} + +function get_user_version_choice() { + if [ "$NON_INTERACTIVE" = true ] || [ "$FORCE" = true ]; then + # Non-interactive mode: use default stable version + echo "stable" + return 0 + fi + + show_version_menu + + read -p "Select version to install (1-3, default: 1): " choice + + case "$choice" in + 2) + write_color "✓ Selected: Latest Development Version" "$COLOR_SUCCESS" + VERSION_TYPE="latest" + TAG_VERSION="" + BRANCH="main" + ;; + 3) + echo "" + write_color "Available recent releases:" "$COLOR_INFO" + echo " v3.2.0, v3.1.0, v3.0.1, v3.0.0" + echo "" + read -p "Enter version tag (e.g., v3.2.0): " tag_input + + if [ -z "$tag_input" ]; then + write_color "⚠ No tag specified, using latest stable" "$COLOR_WARNING" + VERSION_TYPE="stable" + TAG_VERSION="" + else + write_color "✓ Selected: Specific Version $tag_input" "$COLOR_SUCCESS" + VERSION_TYPE="stable" + TAG_VERSION="$tag_input" + fi + BRANCH="main" + ;; + *) + write_color "✓ Selected: Latest Stable Release (default)" "$COLOR_SUCCESS" + VERSION_TYPE="stable" + TAG_VERSION="" + BRANCH="main" + ;; + esac +} + function main() { show_header @@ -395,6 +459,9 @@ function main() { exit 1 fi + # Get version choice from user (interactive menu) + get_user_version_choice + # Determine version information for display local version_info="" case "$VERSION_TYPE" in