> For the complete documentation index, see [llms.txt](https://docs.opscanvas.io/oscar/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.opscanvas.io/oscar/commands/health-checks.md).

# Health Checks

Oscar's `/check health` command runs read-only health checks across your cloud infrastructure, Kubernetes clusters, and version control systems.

## Running Health Checks

```bash
/check health
```

![Health check execution](https://545396582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYOS1iTqmWKUIHFRd1Kze%2Fuploads%2Fgit-blob-85c31448530b91de82b2eec62f3ea84dce39d0c7%2Fcheck_health.png?alt=media)

### What Gets Checked

Oscar automatically discovers and checks:

**Cloud Providers:**

* AWS (IAM, VPC, Security Groups, EC2, RDS, S3, etc.)
* Azure (Resource Groups, Virtual Networks, Storage, etc.)
* GCP (Projects, VPCs, Compute, Storage, etc.)

**Kubernetes:**

* Clusters configured in your kubeconfig
* Deployments, services, pods, resource usage
* Security configurations

**Version Control:**

* GitHub repositories and organizations
* GitLab projects

**Custom Checks:**

* User-defined health check scripts in `~/.config/oscar/custom-checks/`

### Interactive Selection

Oscar presents a checkbox interface to select which systems to check. You can:

* Select/deselect individual systems
* Check all systems at once
* Save your selection for next time

### Health Check Results

After running checks, Oscar:

1. Collects findings from all selected systems
2. Interprets results with AI
3. Categorizes findings by severity
4. Displays a summary with actionable insights

Results are saved locally and can be:

* Viewed in the terminal
* Assigned to team members with `/tasks assign`
* Exported as JSON with `--write-json` flag

## Generate Reusable Scripts

```bash
/check generate [description]
```

Creates a standalone health check script you can:

* Add to CI/CD pipelines
* Schedule with cron
* Share with your team

The generated script includes all dependencies and can run on any system with the required cloud CLI tools installed.

## Options

**`/check health --write-json`** - Save results as JSON file

Saves detailed findings to `~/.config/oscar/health-check-results.json` for programmatic access.

## Notes

* Health checks are read-only and never modify your infrastructure
* Requires valid cloud credentials (configured via `/setup` or environment variables)
* Results are stored locally in `~/.config/oscar/`
* Each finding has a unique ID for task assignment tracking
