feat: Add interactive version selection menu to installation scripts

Enhanced installation experience with interactive version selection:

New Features:
- Interactive menu during installation (no CLI parameters needed)
- 3 options presented to users:
  1. Latest Stable Release (Recommended) - Auto-detected from GitHub
  2. Latest Development Version - Cutting-edge features
  3. Specific Release Version - User enters desired tag
- Clear descriptions for each option
- Visual feedback with colored output
- Default to stable release on Enter

User Experience Improvements:
- Simplified one-liner installation commands
- Version selection happens during installation, not via parameters
- Non-interactive mode still supported via --non-interactive flag
- CLI parameters retained for advanced users (backward compatible)

Installation Scripts:
- install-remote.ps1: Added Show-VersionMenu() and Get-UserVersionChoice()
- install-remote.sh: Added show_version_menu() and get_user_version_choice()

Documentation Updates:
- README.md: Simplified to single installation command with menu note
- README_CN.md: Chinese version with menu explanation
- Removed complex multi-section installation examples

Example Flow:
1. User runs one-liner installation command
2. System checks prerequisites
3. Interactive menu appears with 3 choices
4. User selects version (or presses Enter for default)
5. Installation proceeds with selected version

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-10-02 12:40:33 +08:00
parent c39f311a20
commit b1a2885799
4 changed files with 160 additions and 57 deletions

View File

@@ -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:

View File

@@ -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 正常工作:

View File

@@ -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" {

View File

@@ -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