diff --git a/scripts/install.ps1 b/scripts/install.ps1 index 19889c5..71ee6b6 100755 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -41,15 +41,29 @@ if (-not (Get-Command claude -ErrorAction SilentlyContinue)) { Write-Host "" } -# Installation menu -Write-Host "What would you like to install?" -Write-Host "" -Write-Host "1) skill-creator only (RECOMMENDED - enables you to create your own skills)" -Write-Host "2) All skills" -Write-Host "3) Custom selection" -Write-Host "4) Exit" -Write-Host "" -$choice = Read-Host "Enter your choice (1-4)" +# Check if running interactively +$isInteractive = [Environment]::UserInteractive -and -not [Console]::IsInputRedirected + +if ($isInteractive) { + # Installation menu + Write-Host "What would you like to install?" + Write-Host "" + Write-Host "1) skill-creator only (RECOMMENDED - enables you to create your own skills)" + Write-Host "2) All skills" + Write-Host "3) Custom selection" + Write-Host "4) Exit" + Write-Host "" + $choice = Read-Host "Enter your choice (1-4)" +} else { + Write-Info "Running in non-interactive mode." + Write-Host "Defaulting to option 1: skill-creator only (RECOMMENDED)" + Write-Host "" + Write-Host "To run interactively, download and run directly:" + Write-Host " Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/daymade/claude-code-skills/main/scripts/install.ps1' -OutFile install.ps1" + Write-Host " .\install.ps1" + Write-Host "" + $choice = "1" +} $commands = @() $commands += "/plugin marketplace add daymade/claude-code-skills" @@ -90,7 +104,13 @@ After installation: Write-Host " 7) repomix-unmixer (repomix extraction)" Write-Host " 8) llm-icon-finder (AI/LLM icons)" Write-Host "" - $selections = (Read-Host "Enter skill numbers separated by spaces (e.g., '1 2 3')").Split(' ') + + if ($isInteractive) { + $selections = (Read-Host "Enter skill numbers separated by spaces (e.g., '1 2 3')").Split(' ') + } else { + Write-Info "Non-interactive mode: Installing skill-creator only" + $selections = @("1") + } $skillMap = @{ "1" = "skill-creator" diff --git a/scripts/install.sh b/scripts/install.sh index cc796e0..2582efe 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -34,15 +34,28 @@ fi echo -e "${GREEN}✓ Claude Code detected${NC}" echo "" -# Installation options -echo "What would you like to install?" -echo "" -echo "1) skill-creator only (RECOMMENDED - enables you to create your own skills)" -echo "2) All skills" -echo "3) Custom selection" -echo "4) Exit" -echo "" -read -p "Enter your choice (1-4): " choice +# Check if running interactively +if [ -t 0 ]; then + # Interactive mode + echo "What would you like to install?" + echo "" + echo "1) skill-creator only (RECOMMENDED - enables you to create your own skills)" + echo "2) All skills" + echo "3) Custom selection" + echo "4) Exit" + echo "" + read -p "Enter your choice (1-4): " choice +else + # Non-interactive mode (piped from curl) + echo -e "${YELLOW}Running in non-interactive mode.${NC}" + echo "Defaulting to option 1: skill-creator only (RECOMMENDED)" + echo "" + echo "To run interactively, download and run directly:" + echo " curl -fsSL https://raw.githubusercontent.com/daymade/claude-code-skills/main/scripts/install.sh -o install.sh" + echo " bash install.sh" + echo "" + choice=1 +fi case $choice in 1) @@ -83,7 +96,14 @@ case $choice in echo " 7) repomix-unmixer (repomix extraction)" echo " 8) llm-icon-finder (AI/LLM icons)" echo "" - read -p "Enter skill numbers separated by spaces (e.g., '1 2 3'): " selections + + if [ -t 0 ]; then + read -p "Enter skill numbers separated by spaces (e.g., '1 2 3'): " selections + else + echo -e "${YELLOW}Non-interactive mode: Installing skill-creator only${NC}" + selections="1" + fi + echo "" echo "Run these commands in Claude Code:" echo ""