Conversation
Validates the user's Quorum setup in one command: - Config file exists and parses correctly (YAML validation) - Node.js version compatibility (requires β₯20) - Quorum version (current vs latest on npm) - Each configured provider: lightweight API probe to verify auth Output uses β /β/β οΈ icons with a summary line. Exit code 1 if any errors, 0 otherwise.
Solvely-Colin
left a comment
There was a problem hiding this comment.
Clean implementation β good separation per check, parallel system checks, actionable error messages, sensible exit codes. Tests cover the important failure paths.
A few small things:
-
npm registry URL:
https://registry.npmjs.org/quorum-ai/latestβ confirm this is the published package name. If the npm package is named differently the version check will silently return a warn on every run. -
package.jsonpath:new URL("../../package.json", import.meta.url)works in src/ but verify the relative path holds in the compiled dist/ layout. A subtle breakage if the dist depth differs. -
Provider probe cost: noted in the PR and acceptable for a diagnostic command β just worth a one-liner in the help text so users know it fires a real token call.
Otherwise looks good to merge.
Summary
Adds a
quorum doctorcommand that validates the user's Quorum setup in one command.What it checks
~/.quorum/config.yamlexists and parses correctlyOutput format
Error diagnosis
Provides actionable messages for common failures: 401 (bad key), 402 (no balance), ECONNREFUSED (service down), ENOTFOUND (DNS), timeouts.
Exit codes
0β all checks pass (warnings ok)1β any errorsTests
5 unit tests covering: all-pass, missing config, auth failure, connection refused, mixed results.
Files changed
src/cli/doctor.tsβ new command implementationsrc/cli/doctor.test.tsβ testssrc/cli/index.tsβ register the command