import { OutputMode } from "@outfitter/cli/types"; import { Command } from "commander"; /** * Options for the doctor command. */ interface DoctorOptions { /** Working directory to check (defaults to cwd) */ readonly cwd: string; } /** * Result of a single health check. */ interface CheckResult { /** Error message if check failed */ readonly error?: string; /** Whether the check passed */ readonly passed: boolean; } /** * Bun version check result. */ interface BunVersionCheck extends CheckResult { /** Required minimum version */ readonly required: string; /** Current Bun version */ readonly version: string; } /** * Package.json validation result. */ interface PackageJsonCheck extends CheckResult { /** Package name if found */ readonly name?: string; /** Package version if found */ readonly version?: string; } /** * Dependencies check result. */ interface DependenciesCheck extends CheckResult { /** Number of dependencies found */ readonly count?: number; /** Missing dependencies if any */ readonly missing?: readonly string[]; } /** * Config files check result. */ interface ConfigFilesCheck { /** Whether tsconfig.json exists */ readonly tsconfig: boolean; } /** * Directories check result. */ interface DirectoriesCheck { /** Whether src directory exists */ readonly src: boolean; } /** * Summary of all checks. */ interface DoctorSummary { /** Number of failed checks */ readonly failed: number; /** Number of passed checks */ readonly passed: number; /** Total number of checks */ readonly total: number; } /** * Complete doctor result. */ interface DoctorResult { /** Individual check results */ readonly checks: { readonly bunVersion: BunVersionCheck; readonly packageJson: PackageJsonCheck; readonly dependencies: DependenciesCheck; readonly configFiles: ConfigFilesCheck; readonly directories: DirectoriesCheck; }; /** Exit code (0 = all passed, 1 = some failed) */ readonly exitCode: number; /** Whether this is a workspace root (affects which checks apply) */ readonly isWorkspaceRoot?: boolean; /** Checks intentionally skipped at workspace root */ readonly skippedChecks?: readonly string[]; /** Summary of all checks */ readonly summary: DoctorSummary; /** Per-member summary when running at a workspace root */ readonly workspaceMembers?: readonly WorkspaceMemberHealth[]; } /** * Health summary for a workspace member package. */ interface WorkspaceMemberHealth { /** Member exit code (0 = pass, 1 = failed checks) */ readonly exitCode: number; /** Workspace-relative member path (for example, apps/my-cli) */ readonly path: string; /** Summary for the member doctor run */ readonly summary: DoctorSummary; } /** * Runs the doctor command programmatically. * * @param options - Doctor options * @returns Doctor result with all check results * * @example * ```typescript * const result = await runDoctor({ cwd: process.cwd() }); * * if (result.exitCode === 0) { * console.log("All checks passed!"); * } else { * console.log(`${result.summary.failed} checks failed`); * } * ``` */ declare function runDoctor(options: DoctorOptions): DoctorResult; /** * Formats and outputs doctor results. */ declare function printDoctorResults(result: DoctorResult, options?: { mode?: OutputMode; }): Promise; /** * Registers the doctor command with the CLI program. * * @deprecated Use action-registry CLI wiring via `buildCliCommands(outfitterActions, ...)`. * * @param program - Commander program instance * * @example * ```typescript * import { Command } from "commander"; * import { doctorCommand } from "./commands/doctor.js"; * * const program = new Command(); * doctorCommand(program); * ``` */ declare function doctorCommand(program: Command): void; export { DoctorOptions, CheckResult, BunVersionCheck, PackageJsonCheck, DependenciesCheck, ConfigFilesCheck, DirectoriesCheck, DoctorSummary, DoctorResult, WorkspaceMemberHealth, runDoctor, printDoctorResults, doctorCommand };