> ## Documentation Index
> Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy CLI: Doctor

> Check deployment readiness using praisonai deploy doctor

Check deployment readiness and diagnose issues using `praisonai deploy doctor`.

## CLI

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
pip install praisonai

# Run local checks
praisonai deploy doctor

# Run all checks (local + all providers)
praisonai deploy doctor --all

# Check specific provider
praisonai deploy doctor --provider aws
praisonai deploy doctor --provider azure
praisonai deploy doctor --provider gcp
```

**Expected Output:**

```
🏥 Running deployment health checks...

╭─────────────────────────────────────────────────────────────────────────────╮
│                          Health Check Results                                │
├─────────────────────────────────┬────────────┬──────────────────────────────┤
│ Check                           │ Status     │ Message                      │
├─────────────────────────────────┼────────────┼──────────────────────────────┤
│ Python Version                  │ ✅ PASS    │ Python 3.11.0                │
│ PraisonAI Installed             │ ✅ PASS    │ Version 2.6.2                │
│ agents.yaml Exists              │ ✅ PASS    │ Found at ./agents.yaml       │
│ agents.yaml Valid               │ ✅ PASS    │ Configuration is valid       │
│ OPENAI_API_KEY                  │ ✅ PASS    │ API key is set               │
│ Docker Available                │ ✅ PASS    │ Docker 24.0.0                │
╰─────────────────────────────────┴────────────┴──────────────────────────────╯

Summary:
  Total checks: 6
  Passed: 6
  Failed: 0
```

## CLI Flags

| Flag           | Type   | Default       | Description                                     |
| -------------- | ------ | ------------- | ----------------------------------------------- |
| `--file`, `-f` | string | `agents.yaml` | Path to agents.yaml                             |
| `--provider`   | choice | -             | Check specific provider (`aws`, `azure`, `gcp`) |
| `--all`        | flag   | false         | Run all checks                                  |
| `--verbose`    | flag   | false         | Verbose output                                  |
| `--json`       | flag   | false         | Output as JSON                                  |

## Python

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonai.deploy.doctor import (
    run_all_checks,
    run_local_checks,
    run_aws_checks,
    run_azure_checks,
    run_gcp_checks
)

# Run local checks
report = run_local_checks(agents_file="agents.yaml")

print(f"Total: {report.total_checks}")
print(f"Passed: {report.passed_checks}")
print(f"Failed: {report.failed_checks}")

for check in report.checks:
    status = "✅" if check.passed else "❌"
    print(f"{status} {check.name}: {check.message}")
    if not check.passed and check.fix_suggestion:
        print(f"   Fix: {check.fix_suggestion}")
```

## Check Types

### Local Checks

Run by default or with `--file`:

| Check               | Description                  |
| ------------------- | ---------------------------- |
| Python Version      | Python 3.8+ required         |
| PraisonAI Installed | Package installed            |
| agents.yaml Exists  | File exists at path          |
| agents.yaml Valid   | Configuration is valid       |
| OPENAI\_API\_KEY    | API key environment variable |
| Docker Available    | Docker daemon running        |

### AWS Checks

Run with `--provider aws`:

| Check             | Description                           |
| ----------------- | ------------------------------------- |
| AWS CLI Installed | aws command available                 |
| AWS Credentials   | Valid credentials configured          |
| AWS Region        | Region is set                         |
| ECR Access        | Can access Elastic Container Registry |
| ECS Access        | Can access Elastic Container Service  |

### Azure Checks

Run with `--provider azure`:

| Check               | Description                |
| ------------------- | -------------------------- |
| Azure CLI Installed | az command available       |
| Azure Logged In     | Valid login session        |
| Subscription Set    | Subscription ID configured |
| Resource Group      | Resource group exists      |
| Container Registry  | ACR access                 |

### GCP Checks

Run with `--provider gcp`:

| Check                | Description              |
| -------------------- | ------------------------ |
| GCloud CLI Installed | gcloud command available |
| GCloud Authenticated | Valid authentication     |
| Project Set          | Project ID configured    |
| Cloud Run API        | API enabled              |
| Artifact Registry    | Registry access          |

## Failed Check Example

```
🏥 Running deployment health checks...

╭─────────────────────────────────────────────────────────────────────────────╮
│                          Health Check Results                                │
├─────────────────────────────────┬────────────┬──────────────────────────────┤
│ Check                           │ Status     │ Message                      │
├─────────────────────────────────┼────────────┼──────────────────────────────┤
│ Python Version                  │ ✅ PASS    │ Python 3.11.0                │
│ PraisonAI Installed             │ ✅ PASS    │ Version 2.6.2                │
│ agents.yaml Exists              │ ❌ FAIL    │ File not found               │
│ OPENAI_API_KEY                  │ ❌ FAIL    │ Not set                      │
│ Docker Available                │ ✅ PASS    │ Docker 24.0.0                │
╰─────────────────────────────────┴────────────┴──────────────────────────────╯

Summary:
  Total checks: 5
  Passed: 3
  Failed: 2

💡 Fix Suggestions:

agents.yaml Exists:
  Run: praisonai deploy init --file agents.yaml

OPENAI_API_KEY:
  Run: export OPENAI_API_KEY="your-api-key"
```

## JSON Output

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai deploy doctor --json
```

```json theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
{
  "total_checks": 6,
  "passed": 5,
  "failed": 1,
  "all_passed": false,
  "checks": [
    {
      "name": "Python Version",
      "passed": true,
      "message": "Python 3.11.0",
      "fix_suggestion": null
    },
    {
      "name": "OPENAI_API_KEY",
      "passed": false,
      "message": "Not set",
      "fix_suggestion": "export OPENAI_API_KEY=\"your-api-key\""
    }
  ]
}
```

## Troubleshooting

| Issue                 | Fix                           |
| --------------------- | ----------------------------- |
| agents.yaml not found | `praisonai deploy init`       |
| API key not set       | `export OPENAI_API_KEY="..."` |
| Docker not running    | Start Docker daemon           |
| AWS credentials       | `aws configure`               |
| Azure not logged in   | `az login`                    |
| GCP not authenticated | `gcloud auth login`           |

## Related

* [Deploy CLI Overview](./index) - All deploy commands
* [Status](./status) - Check deployment status
* [API Deploy](./api) - Deploy as local API
