Skip to content

doctor

wrknv.wenv.doctor

Doctor command for diagnosing wrknv environment issues.

This module provides diagnostic tools to help users identify and fix common problems with their wrknv setup.

Classes

WrknvDoctor

WrknvDoctor()

Diagnose and report on wrknv environment health.

Source code in wrknv/wenv/doctor.py
def __init__(self) -> None:
    self.console = Console()
    self.checks_passed = []
    self.checks_failed = []
    self.checks_warning = []
Functions
run
run(verbose: bool = False) -> int

Run all diagnostic checks.

Parameters:

Name Type Description Default
verbose bool

If True, show detailed output.

False

Returns:

Type Description
int

Exit code (0 if all checks pass, 1 otherwise).

Source code in wrknv/wenv/doctor.py
def run(self, verbose: bool = False) -> int:
    """
    Run all diagnostic checks.

    Args:
        verbose: If True, show detailed output.

    Returns:
        Exit code (0 if all checks pass, 1 otherwise).
    """
    self.console.print("\n[bold cyan]🩺 Running wrknv doctor...[/bold cyan]\n")

    # Run all checks
    self._check_system_info()
    self._check_wrknv_installation()
    self._check_dependencies()
    self._check_workenv_structure()
    self._check_env_script()
    self._check_config_files()
    self._check_sibling_packages()
    self._check_common_issues()

    # Print summary
    self._print_summary(verbose)

    # Return appropriate exit code
    if self.checks_failed:
        return 1
    return 0

Functions

run_doctor

run_doctor(verbose: bool = False) -> int

Run the doctor diagnostic tool.

Parameters:

Name Type Description Default
verbose bool

If True, show detailed output.

False

Returns:

Type Description
int

Exit code.

Source code in wrknv/wenv/doctor.py
def run_doctor(verbose: bool = False) -> int:
    """
    Run the doctor diagnostic tool.

    Args:
        verbose: If True, show detailed output.

    Returns:
        Exit code.
    """
    doctor = WrknvDoctor()
    return doctor.run(verbose)