Executable dispatcher
src/main.cpp
src/main.cpp is the actual command dispatcher for the current native tool. It only recognizes `check` and `doctor` today, formats reports for terminal or JSON output, and offers an interactive prompt to apply repo fixes when a repo-level issue is detected.
Reference
Usage: cuda-doctor-core <check|doctor> [auto] [--json]
int main(int argc, char** argv);What it does
- Validates the accepted argument combinations.
- Runs `cuda_doctor::commands::run_check()` or `run_doctor()`.
- Prints terminal-friendly reports or JSON payloads.
- Returns `0` for overall OK and `1` for non-OK health states.
- Detects when the report contains a repo issue and offers an interactive repair prompt when the session is a real TTY.
Caveats
Current command limit
Even though the README talks about `build`, `setup`, and `validate`, this dispatcher only accepts `check` and `doctor` today.
JSON mode bypasses the human prompt path entirely, which is sensible for automation but means the auto-fix invitation only appears in human terminal sessions.
Related files
Command implementation
src/commands/check.cpp
Runs the platform, driver, CUDA, and GPU probes and summarizes them into a report.
Command implementation
src/commands/doctor.cpp
Extends `check` with repo scanning, optional auto-configuration, auto-fix behavior, and next-step generation.
Core contract
include/core/report.hpp
Defines the status enum, probe shape, report structure, and status-to-string helper used throughout the native code.
Python wrapper
cuda_doctor/cli.py
Python entrypoint that resolves the native binary and forwards parsed CLI arguments into it.