Skip to content

Commit 9aaee45

Browse files
committed
fix(install): update post-install quick start for auto-started server
Adjust installer output to reflect the new default background server startup. Show run/ps/stop-service guidance when startup is confirmed, and keep serve fallback messaging when startup verification fails. Made-with: Cursor
1 parent 5e87f67 commit 9aaee45

File tree

2 files changed

+36
-8
lines changed

2 files changed

+36
-8
lines changed

scripts/install.ps1

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ function Start-CsghubLiteServer {
380380
& $BinaryPath ps *> $null
381381
if ($LASTEXITCODE -eq 0) {
382382
Info "csghub-lite server is already running."
383+
$script:ServerStartStatus = "running"
383384
return
384385
}
385386

@@ -394,13 +395,16 @@ function Start-CsghubLiteServer {
394395
& $BinaryPath ps *> $null
395396
if ($LASTEXITCODE -eq 0) {
396397
Info "Started csghub-lite server in background."
398+
$script:ServerStartStatus = "started"
397399
} else {
398400
Warn "Could not verify background server startup. Try: csghub-lite serve"
401+
$script:ServerStartStatus = "failed"
399402
}
400403
}
401404

402405
# ---- Main ----
403406
$script:Region = Detect-Region
407+
$script:ServerStartStatus = "failed"
404408
Info "Detected region: $script:Region"
405409

406410
Info "Checking for existing installation..."
@@ -419,14 +423,24 @@ Start-CsghubLiteServer -BinaryPath (Join-Path $InstallDir "csghub-lite.exe")
419423

420424
Write-Host ""
421425
Write-Host "Quick start:" -ForegroundColor White
422-
Write-Host " csghub-lite serve # Start server with Web UI"
423-
Write-Host " csghub-lite run Qwen/Qwen3-0.6B-GGUF # Run a model"
424-
Write-Host " csghub-lite ps # List running models"
426+
if ($script:ServerStartStatus -eq "started" -or $script:ServerStartStatus -eq "running") {
427+
Write-Host " csghub-lite run Qwen/Qwen3-0.6B-GGUF # Run a model"
428+
Write-Host " csghub-lite ps # List running models"
429+
Write-Host " csghub-lite stop-service # Stop background server"
430+
} else {
431+
Write-Host " csghub-lite serve # Start server with Web UI"
432+
Write-Host " csghub-lite run Qwen/Qwen3-0.6B-GGUF # Run a model"
433+
Write-Host " csghub-lite ps # List running models"
434+
}
425435
Write-Host " csghub-lite login # Set CSGHub token"
426436
Write-Host " csghub-lite --help # Show all commands"
427437
Write-Host ""
428438
Write-Host "Web UI:" -ForegroundColor White
429-
Write-Host " Start the server and open " -NoNewline
439+
if ($script:ServerStartStatus -eq "started" -or $script:ServerStartStatus -eq "running") {
440+
Write-Host " Server is already running. Open " -NoNewline
441+
} else {
442+
Write-Host " Start the server and open " -NoNewline
443+
}
430444
Write-Host "http://localhost:11435" -ForegroundColor Cyan -NoNewline
431445
Write-Host " in your browser."
432446
Write-Host " Dashboard, Marketplace, Library and Chat are all available."

scripts/install.sh

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ start_csghub_lite_server() {
454454
_server_bin="$1"
455455
if "$_server_bin" ps >/dev/null 2>&1; then
456456
info "csghub-lite server is already running."
457+
SERVER_START_STATUS="running"
457458
return 0
458459
fi
459460

@@ -466,13 +467,16 @@ start_csghub_lite_server() {
466467
sleep 1
467468
if "$_server_bin" ps >/dev/null 2>&1; then
468469
info "Started csghub-lite server in background."
470+
SERVER_START_STATUS="started"
469471
else
470472
warn "Could not verify background server startup. Try: ${BINARY_NAME} serve"
473+
SERVER_START_STATUS="failed"
471474
fi
472475
}
473476

474477
main() {
475478
TOTAL_STEPS=6
479+
SERVER_START_STATUS="failed"
476480
printf "\n${BOLD}Installing ${BINARY_NAME}${NC}\n\n"
477481

478482
# Step 1: Detect environment
@@ -561,14 +565,24 @@ main() {
561565
printf "\n${GREEN}${BOLD}${BINARY_NAME} ${VERSION} installed successfully!${NC}\n\n"
562566

563567
printf "${BOLD}Quick start:${NC}\n"
564-
printf " ${BINARY_NAME} serve # Start server with Web UI\n"
565-
printf " ${BINARY_NAME} run Qwen/Qwen3-0.6B-GGUF # Run a model\n"
566-
printf " ${BINARY_NAME} ps # List running models\n"
568+
if [ "$SERVER_START_STATUS" = "started" ] || [ "$SERVER_START_STATUS" = "running" ]; then
569+
printf " ${BINARY_NAME} run Qwen/Qwen3-0.6B-GGUF # Run a model\n"
570+
printf " ${BINARY_NAME} ps # List running models\n"
571+
printf " ${BINARY_NAME} stop-service # Stop background server\n"
572+
else
573+
printf " ${BINARY_NAME} serve # Start server with Web UI\n"
574+
printf " ${BINARY_NAME} run Qwen/Qwen3-0.6B-GGUF # Run a model\n"
575+
printf " ${BINARY_NAME} ps # List running models\n"
576+
fi
567577
printf " ${BINARY_NAME} login # Set CSGHub token\n"
568578
printf " ${BINARY_NAME} --help # Show all commands\n"
569579
printf "\n"
570580
printf "${BOLD}Web UI:${NC}\n"
571-
printf " Start the server and open ${CYAN}http://localhost:11435${NC} in your browser.\n"
581+
if [ "$SERVER_START_STATUS" = "started" ] || [ "$SERVER_START_STATUS" = "running" ]; then
582+
printf " Server is already running. Open ${CYAN}http://localhost:11435${NC} in your browser.\n"
583+
else
584+
printf " Start the server and open ${CYAN}http://localhost:11435${NC} in your browser.\n"
585+
fi
572586
printf " Dashboard, Marketplace, Library and Chat are all available.\n"
573587
printf "\n"
574588

0 commit comments

Comments
 (0)