Skip to content

Commit 78ad217

Browse files
committed
cli status fix
1 parent 335da23 commit 78ad217

3 files changed

Lines changed: 20 additions & 5 deletions

File tree

solo_server/commands/status.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
from tabulate import tabulate
55
import json
66

7-
app = typer.Typer()
8-
9-
@app.command()
107
def status():
118
"""Check running models and system status."""
129
display_hardware_info(typer)
1310

11+
# First check if docker is running
12+
try:
13+
subprocess.run(["docker", "ps"], capture_output=True, check=True)
14+
except subprocess.CalledProcessError:
15+
typer.echo("\n❌ Solo server not running. Please start solo-server first.")
16+
return
17+
1418
# Check for running solo container
1519
container_result = subprocess.run(["docker", "ps", "-f", "name=solo", "--format", "{{json .}}"],
1620
capture_output=True, text=True, check=True)

solo_server/commands/stop.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,18 @@ def stop(name: str = ""):
55
"""
66
Stops the Ollama Docker container and any running models.
77
"""
8-
typer.echo("🛑 Stopping Solo Server...")
8+
9+
# Check if docker is running
10+
try:
11+
subprocess.run(["docker", "info"],
12+
check=True,
13+
stdout=subprocess.PIPE,
14+
stderr=subprocess.PIPE)
15+
except subprocess.CalledProcessError:
16+
typer.echo("\n✅ Solo server is already stopped (Docker is not running)\n")
17+
return
18+
19+
typer.echo("Stopping Solo Server...")
920

1021
try:
1122
# Stop the Docker container

solo_server/start.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def start():
155155
docker_run_cmd.append("ollama/ollama")
156156

157157
typer.echo("🚀 Starting Solo Server...")
158-
subprocess.run(docker_run_cmd, check=True)
158+
subprocess.run(docker_run_cmd, check=True, capture_output=True)
159159

160160
# Wait for container to be ready with timeout
161161
timeout = 30

0 commit comments

Comments
 (0)