ray doctor
Run a pragmatic security and health audit on your repository, secrets, and configuration
Run a pragmatic security and health audit on your repository, secrets, and configuration
Synopsis
ray doctor [options]Flags & Options
| Flag / Option | Type | Description |
|---|---|---|
--fix | boolean | Automatically apply safe remediation fixes for detected configuration or security issues |
-y, --yes(--force) | boolean | Automatically answer yes to all confirmation prompts (ideal for automated CI/CD scripts) |
--strict(--exit-code) | boolean | Abort execution immediately with an exit code if any required secret is missing, empty, or drifting |
--verbose | boolean | Enable debug logging showing environment resolution, injected key names, and execution metadata |
--offline | boolean | Run using encrypted local disk cache without connecting to the remote Ray Secrets API server |
-q, --quiet | boolean | Silence banners, progress spinners, and status output; only print process output and critical errors |
--ci | boolean | Optimize execution for headless CI/CD runners (disables spinners, prompts, colors, and update checks) |
Common Examples
1. Run comprehensive security and health audit
Scans your workspace repository for tracked secret files, insecure permissions, template drift, placeholder values, and API connectivity.
ray doctor2. Automatically heal Git hygiene and template drift issues
Remediates detected issues: untracks accidental .env files from Git, updates .gitignore rules, fixes file permissions, and reconciles template drift.
ray doctor --fix3. Auto-remediate issues non-interactively
Bypasses interactive confirmation prompts with -y when applying automatic fixes.
ray doctor --fix --yes4. Fail-fast CI/CD pipeline gate
Exits with non-zero exit code 1 if any warning, security flaw, or configuration drift is detected, enforcing strict quality in automated pipelines.
ray doctor --strict --ci5. Display detailed diagnostic trace for all checks
Outputs verbose diagnostic information including check timings, skipped checks, and system metadata.
ray doctor --verbose6. Perform local repository and permission checks without network calls
Runs offline diagnostics strictly against local files and Git history, bypassing remote API connectivity checks.
ray doctor --offline7. Emit structured JSON audit report for compliance
Outputs raw JSON diagnostic report including check statuses, warnings, and remediation suggestions for automated ingestion.
ray doctorExit Codes
| Code | Meaning | Recommended Action |
|---|---|---|
| 0 | Success. The command completed with no errors. | None required. |
| 1 | Runtime or execution failure. A child process returned non-zero status or a general error occurred. | Inspect process output or run with --verbose. |
| 2 | Authentication failed. Token is missing, expired, or invalid. | Run `ray login` or update `RAY_TOKEN`. |
| 3 | Configuration or binding error. Project or environment context was not found. | Run `ray init` or specify `--project` and `--env`. |
| 4 | Network or API failure. Failed to reach the Ray Secrets vault. | Check internet connection or run `ray doctor`. |
Ready to eliminate plaintext secrets?
Create a workspace to organize environments, invite your team, and generate scoped Service Tokens for CI/CD.