Skip to content

CLI: Add w3-kit doctor command for environment diagnostics #87

@PetarStoev02

Description

@PetarStoev02

Context

When users hit issues with the CLI, the first question is usually "what does your env look like?" — node version, network access, registry reachable, package versions, etc. A doctor command surfaces all of this in one place and gives users something concrete to paste into bug reports.

What to build

Implement w3-kit doctor that runs a battery of checks and prints a readable report:

  • Node version (and whether it meets the supported range)
  • npm/pnpm/bun version
  • OS / arch
  • Network: can the CLI reach the registry source / GitHub / npm?
  • Installed @w3-kit/* package versions in the current project (if any)
  • Any obvious config problems

Each check should be a single or line with an inline explanation when it fails.

Acceptance criteria

  • w3-kit doctor runs all checks without crashing even if some fail
  • Exit code reflects overall health (0 if all green, non-zero if any check fails)
  • Output is concise and copy-pasteable
  • --json flag (see related issue) also works here, returning a structured report
  • Tests mock the environment so checks are deterministic

Pointers

  • Related: cli --json flag

Complexity

🟡 Intermediate

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions