windows-installer.ps1 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. $RED = "Red"
  2. $GREEN = "Green"
  3. $BLUE = "Blue"
  4. $BOLD = "" # No direct bold support, but we'll emphasize via structure
  5. $RESET = "" # No need for reset
  6. # Welcome message with colors
  7. Write-Host "=====================================" -ForegroundColor $BLUE
  8. Write-Host " Welcome to AIOS Installation! " -ForegroundColor $GREEN
  9. Write-Host "=====================================" -ForegroundColor $BLUE
  10. Write-Host ""
  11. # Cloning the AIOS repository
  12. Write-Host "Cloning the AIOS..."
  13. git clone https://github.com/agiresearch/AIOS.git
  14. if ($LASTEXITCODE -ne 0) {
  15. Write-Host "Failed to clone the AIOS repository." -ForegroundColor $RED
  16. exit 1
  17. }
  18. Set-Location "AIOS"
  19. # Creating a virtual environment
  20. Write-Host "Creating a virtual environment..."
  21. python -m venv venv
  22. if ($LASTEXITCODE -ne 0) {
  23. Write-Host "Failed to create virtual environment." -ForegroundColor $RED
  24. exit 1
  25. }
  26. # Activating the virtual environment
  27. & "venv\Scripts\Activate.ps1"
  28. # Setting up API keys
  29. Write-Host "Setting up API keys..."
  30. $CONFIG_FILE = ".env"
  31. if (-Not (Test-Path $CONFIG_FILE)) {
  32. New-Item -ItemType File -Path $CONFIG_FILE
  33. }
  34. # Function to save API keys
  35. function Save-APIKey {
  36. param (
  37. [string]$key_name,
  38. [string]$user_input
  39. )
  40. if ($user_input -ne "") {
  41. Add-Content -Path $CONFIG_FILE -Value "$key_name=$user_input"
  42. Write-Host "$key_name has been saved."
  43. }
  44. else {
  45. Write-Host "$key_name was skipped."
  46. }
  47. }
  48. # Prompt for API keys
  49. Write-Host "Please enter your API keys:"
  50. $OPENAI_API_KEY = Read-Host "Enter your OPENAI API key for using OpenAI models (or press Enter to skip)"
  51. Save-APIKey -key_name "OPENAI_API_KEY" -user_input $OPENAI_API_KEY
  52. $GEMINI_API_KEY = Read-Host "Enter your GEMINI API key for using GEMINI models (or press Enter to skip)"
  53. Save-APIKey -key_name "GEMINI_API_KEY" -user_input $GEM