diff --git a/solo_server/commands/status.py b/solo_server/commands/status.py index 2e2c7ec..f7ff4fd 100644 --- a/solo_server/commands/status.py +++ b/solo_server/commands/status.py @@ -4,13 +4,17 @@ from tabulate import tabulate import json -app = typer.Typer() - -@app.command() def status(): """Check running models and system status.""" display_hardware_info(typer) + # First check if docker is running + try: + subprocess.run(["docker", "ps"], capture_output=True, check=True) + except subprocess.CalledProcessError: + typer.echo("\nāŒ Solo server not running. Please start solo-server first.") + return + # Check for running solo container container_result = subprocess.run(["docker", "ps", "-f", "name=solo", "--format", "{{json .}}"], capture_output=True, text=True, check=True) diff --git a/solo_server/commands/stop.py b/solo_server/commands/stop.py index e9486a8..6a2a7cb 100644 --- a/solo_server/commands/stop.py +++ b/solo_server/commands/stop.py @@ -5,7 +5,18 @@ def stop(name: str = ""): """ Stops the Ollama Docker container and any running models. """ - typer.echo("šŸ›‘ Stopping Solo Server...") + + # Check if docker is running + try: + subprocess.run(["docker", "info"], + check=True, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + except subprocess.CalledProcessError: + typer.echo("\nāœ… Solo server is already stopped (Docker is not running)\n") + return + + typer.echo("Stopping Solo Server...") try: # Stop the Docker container diff --git a/solo_server/start.py b/solo_server/start.py index 68f15a0..c2834f9 100644 --- a/solo_server/start.py +++ b/solo_server/start.py @@ -155,7 +155,7 @@ def start(): docker_run_cmd.append("ollama/ollama") typer.echo("šŸš€ Starting Solo Server...") - subprocess.run(docker_run_cmd, check=True) + subprocess.run(docker_run_cmd, check=True, capture_output=True) # Wait for container to be ready with timeout timeout = 30