Skip to content

System Health

cs doctor --fix diagnoses and self-repairs the most common issues. This page covers what it checks and what it cannot fix automatically.


cs doctor

The doctor command runs intelligent, adaptive diagnostics across your entire CloudSlash stack. It only checks what is relevant to your setup.

cs doctor

How It Works

Doctor is dynamic, not static. It discovers your environment and adapts:

  • Cloud Providers: discovers which providers you actually use by checking credential files AND environment variables. If you have AWS creds but no AWS plugin, it tells you. If you have the GCP plugin but no GCP creds, it warns you. It actually validates credentials by calling aws sts get-caller-identity, gcloud auth list, az account show, and kubectl cluster-info.

  • AI Backends: checks ALL configured AI providers: Ollama (local health check), OpenAI ($OPENAI_API_KEY), Anthropic ($ANTHROPIC_API_KEY), Google Gemini ($GEMINI_API_KEY), and config.yaml settings. It only warns if NO AI backend is available.

  • Plugins: cross-references discovered plugins with cloud credentials. Shows each plugin's binary path.

  • Subprocess Management Orphans: detects stale sockets (daemon crashed), checks HTTP API latency, and tests

  • Network Connections & Port Binding: connectivity. It only checks API/WebSocket if the daemon socket is alive.

Example Output

CLOUDSLASH DOCTOR

  Core Infrastructure
  Data directory       [OK]    ~/.cloudslash
  Config file          [OK]    config.yaml
  BadgerDB             [OK]    42.3 MB

  Daemon & Connectivity
  Daemon socket        [OK]    connected (3ms)
  HTTP API             [OK]    healthy (12ms)
  WebSocket            [OK]    reachable

  Cloud Providers
  AWS                  [OK]    verified (arn:aws:iam::123:user/dev), plugin: loaded
  GCP                  [WARN]  creds: ADC: but plugin not installed  → run 'cs plugin install gcp'
  Kubernetes           [OK]    verified (k8s.local), plugin: loaded

  AI Backends
  Ollama (local)       [OK]    running
  OpenAI               [OK]    $OPENAI_API_KEY set
  Active model         [OK]    qwen2.5:7b

  Plugins
  cloudslash-plugin-aws  [OK]  ~/.cloudslash/plugins/cloudslash-plugin-aws
  cloudslash-plugin-k8s  [OK]  ~/.cloudslash/plugins/cloudslash-plugin-k8s

  History & Data
  s.a.u state           [OK]    47 saga entries
  Snapshots            [OK]    12 snapshots (retention: 90 days)
  Trend data           [OK]    89 entries (0.1 MB)
  Last scan            [OK]    2h ago: 10,420 nodes, 847 waste, $14,230/mo savings

Auto-Fix Mode

cs doctor --fix

Auto-fix can:

  • Create missing directories (plugins/, policies/, snapshots/)
  • Remove stale daemon sockets from crashed processes
  • Start the daemon automatically if it is not running
  • Create a default config.yaml with sensible defaults
  • Local State Integrity: Initialize empty BadgerDB and s.a.u state directories

cs status

Get a quick snapshot of your infrastructure without launching the TUI:

cs status

Online Mode (daemon running)

CLOUDSLASH STATUS

  Daemon                 ONLINE
  Waste nodes            847
  Projected savings      $14,230/mo
  Guardrail failures     12
  Drift detected         3 resources
  s.a.u blocked           5 nodes

  Last scan              18h ago (+23 since last scan)

Offline Mode (daemon stopped)

Falls back to the last saved snapshot automatically:

CLOUDSLASH STATUS

  Daemon                 OFFLINE (showing last scan)
  Total nodes            10,420
  Waste nodes            847
  Projected savings      $14,230/mo

  Last scan              2d ago

History Delta

Status compares current waste against the last snapshot:

  • Green (-15 since last scan): waste decreased
  • Red (+23 since last scan): new waste appeared