diagnose
rai diagnose [OPTIONS]Print version, config, and connection diagnostics for bug reports.
Renders the installed rai version + Python runtime, the active
config file and profile, the resolved default connection’s fields,
and (unless --no-connect) a Snowflake select 1 smoke test.
Robust to any config-load failure (missing file, schema
validation error, malformed YAML, etc.): the Tooling block plus a
"Local Configuration: <status>" row are always rendered so the
output remains useful in bug reports. The yellow suggestion panel
adapts to the error type — missing file → rai init; validation
failure → “fix the listed fields”; any other error → “see the error
above”.
Honors --json / --output yaml to emit a single
{"diagnose": {...}} envelope; scripts always receive every
section regardless of --no-connect (the connectivity.checked
flag tells consumers whether the probe ran). When config loading
fails, config.found is false and config.load_error
carries a uniform {type, message, file_path, location, attempted_sources, validation_errors} block — branch on
load_error.type for type-specific details.
Exit codes:
0— diagnostics rendered cleanly and (a) connectivity probe succeeded, or (b)--no-connectwas passed (report is the deliverable; user opted out of validation).1— connectivity probe ran and failed, or config could not be loaded and--no-connectwas not passed.
Examples: rai diagnose rai diagnose —no-connect rai diagnose —json rai diagnose —output yaml
Options
Section titled “Options”| Option | Type | Description |
|---|---|---|
--no-connect | Boolean | Skip the connectivity check (offline-safe). The other sections are still printed. Default: False. |