> ## 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: Status & Destroy

> Check deployment status and destroy deployments using praisonai deploy

Check deployment status and manage lifecycle using `praisonai deploy status` and `praisonai deploy destroy`.

## Status

Check the current status of a deployment.

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai deploy status --file agents.yaml
```

**Expected Output:**

```
📊 Checking deployment status...

╭─────────────────────────────────────────────────────────────────────────────╮
│                            Deployment Status                                 │
├─────────────────┬───────────────────────────────────────────────────────────┤
│ Property        │ Value                                                     │
├─────────────────┼───────────────────────────────────────────────────────────┤
│ State           │ RUNNING                                                   │
│ Service Name    │ praisonai-service                                         │
│ Provider        │ api                                                       │
│ Region          │ N/A                                                       │
│ URL             │ http://127.0.0.1:8005                                     │
│ Healthy         │ ✅ Yes                                                    │
│ Instances       │ 1/1                                                       │
│ Created         │ 2024-01-15T10:30:00Z                                      │
│ Updated         │ 2024-01-15T10:30:00Z                                      │
╰─────────────────┴───────────────────────────────────────────────────────────╯
```

### Status CLI Flags

| Flag              | Type   | Default       | Description            |
| ----------------- | ------ | ------------- | ---------------------- |
| `--file`, `-f`    | string | `agents.yaml` | Path to agents.yaml    |
| `--verbose`, `-v` | flag   | false         | Show detailed metadata |
| `--json`          | flag   | false         | Output as JSON         |

### Status States

| State       | Description                     |
| ----------- | ------------------------------- |
| `RUNNING`   | Service is running and healthy  |
| `STOPPED`   | Service is stopped              |
| `PENDING`   | Service is starting or updating |
| `FAILED`    | Service failed to start         |
| `NOT_FOUND` | No deployment found             |
| `UNKNOWN`   | Status cannot be determined     |

### Verbose Output

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai deploy status --file agents.yaml --verbose
```

Shows additional metadata like container IDs, task ARNs, etc.

### JSON Output

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai deploy status --file agents.yaml --json
```

```json theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
{
  "state": "running",
  "url": "http://127.0.0.1:8005",
  "message": "Service is running",
  "service_name": "praisonai-service",
  "provider": "api",
  "region": null,
  "healthy": true,
  "instances_running": 1,
  "instances_desired": 1,
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T10:30:00Z",
  "metadata": {}
}
```

## Destroy

Delete/destroy a deployment.

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai deploy destroy --file agents.yaml
```

**Expected Output:**

```
⚠️  Warning: This will destroy the deployment!
File: agents.yaml
Service: praisonai-service
Provider: api

Type 'yes' to confirm destruction: yes

🗑️ Destroying deployment...

✅ Deployment destroyed successfully

Deleted resources:
  • process: praisonai-api-8005
```

### Destroy CLI Flags

| Flag           | Type   | Default       | Description              |
| -------------- | ------ | ------------- | ------------------------ |
| `--file`, `-f` | string | `agents.yaml` | Path to agents.yaml      |
| `--yes`, `-y`  | flag   | false         | Skip confirmation prompt |
| `--force`      | flag   | false         | Force deletion           |
| `--json`       | flag   | false         | Output as JSON           |

### Skip Confirmation

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai deploy destroy --file agents.yaml --yes
```

### Force Destroy

Force deletion even if some resources fail to delete:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai deploy destroy --file agents.yaml --yes --force
```

### Cloud Destroy Example

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai deploy destroy --file agents.yaml --yes
```

**Expected Output (AWS):**

```
🗑️ Destroying deployment...

✅ Deployment destroyed successfully

Deleted resources:
  • ecs_service: praisonai-service
  • ecs_task_definition: praisonai-task:1
  • ecr_image: praisonai-app:latest
  • cloudwatch_log_group: /ecs/praisonai-service
```

## Python

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonai.deploy import Deploy

# Load deployment
deploy = Deploy.from_yaml("agents.yaml")

# Check status
status = deploy.status()
print(f"State: {status.state.value}")
print(f"URL: {status.url}")
print(f"Healthy: {status.healthy}")

# Destroy
result = deploy.destroy(force=False)
if result.success:
    print(f"Destroyed: {result.resources_deleted}")
else:
    print(f"Error: {result.error}")
```

## Troubleshooting

| Issue             | Fix                                                  |
| ----------------- | ---------------------------------------------------- |
| NOT\_FOUND status | Deployment doesn't exist, run `praisonai deploy run` |
| FAILED status     | Check logs, run `praisonai deploy doctor`            |
| Destroy failed    | Try with `--force` flag                              |
| Permission denied | Check cloud provider credentials                     |

## Related

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