diff --git a/install.ps1 b/install.ps1 index 0d65ef4e06..6bf37e39db 100644 --- a/install.ps1 +++ b/install.ps1 @@ -109,11 +109,22 @@ function Install-UnslothStudio { Write-Host " Unsloth Studio installed!" Write-Host "=========================================" Write-Host "" - Write-Host " To launch, run:" - Write-Host "" - Write-Host " .\${VenvName}\Scripts\activate" - Write-Host " unsloth studio -H 0.0.0.0 -p 8888" - Write-Host "" + + # Launch studio automatically in interactive terminals; + # in non-interactive environments (CI, Docker) just print instructions. + $IsInteractive = [Environment]::UserInteractive -and (-not [Console]::IsInputRedirected) + if ($IsInteractive) { + Write-Host "==> Launching Unsloth Studio..." + Write-Host "" + $UnslothExe = Join-Path $VenvName "Scripts\unsloth.exe" + & $UnslothExe studio -H 0.0.0.0 -p 8888 + } else { + Write-Host " To launch, run:" + Write-Host "" + Write-Host " .\${VenvName}\Scripts\activate" + Write-Host " unsloth studio -H 0.0.0.0 -p 8888" + Write-Host "" + } } Install-UnslothStudio diff --git a/install.sh b/install.sh index 50303ab75a..7ec5e7b148 100755 --- a/install.sh +++ b/install.sh @@ -214,8 +214,17 @@ echo "=========================================" echo " Unsloth Studio installed!" echo "=========================================" echo "" -echo " To launch, run:" -echo "" -echo " source ${VENV_NAME}/bin/activate" -echo " unsloth studio -H 0.0.0.0 -p 8888" -echo "" + +# Launch studio automatically in interactive terminals; +# in non-interactive environments (Docker, CI, cloud-init) just print instructions. +if [ -t 0 ]; then + echo "==> Launching Unsloth Studio..." + echo "" + exec "$VENV_NAME/bin/unsloth" studio -H 0.0.0.0 -p 8888 +else + echo " To launch, run:" + echo "" + echo " source ${VENV_NAME}/bin/activate" + echo " unsloth studio -H 0.0.0.0 -p 8888" + echo "" +fi