CLI bridge
Implementedv0.0.0
cuda_doctor/cli.py
This file is the Python face of the tool. It parses `check` or `doctor`, validates that `auto` only accompanies `doctor`, resolves `cuda-doctor-core`, and then shells out to the native executable without trying to re-implement the logic in Python.
Reference
Forwarding contractpython
binary = resolve_core_binary()
forwarded = [str(binary), args.command]
if args.mode is not None:
forwarded.append(args.mode)
if args.json:
forwarded.append("--json")
completed = subprocess.run(forwarded, check=False)What it does
- Checks for a local `.dist/cuda-doctor-core` first.
- Falls back to a globally discoverable `cuda-doctor-core` on PATH.
- Parses the public CLI surface with argparse.
- Forwards the exit code from the native executable back to the shell.
Caveats
The Python wrapper does not contain fallback diagnosis logic. If the native binary is missing, the wrapper fails immediately. That keeps the responsibilities clean but means packaging and native build steps matter.