cuda-doctor logo

Executable dispatcher

Implementedv0.0.0

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

Current CLI surfacecpp
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.