feat(cli): add --doctor to report install health - #818
Open
diegoalvarezf wants to merge 1 commit into
Open
Conversation
Half-broken installs are hard to diagnose today: a hook file deleted or edited by hand, a settings.json that stopped parsing, entries left behind pointing at scripts that no longer exist (JuliusBrussee#471), or standalone hooks still wired alongside the plugin so every event fires twice (JuliusBrussee#392). The symptom is a session that crashes, double-fires, or silently does nothing, with no hint of which piece is wrong. `caveman --doctor` reports on an existing install and exits without touching anything. It probes for the plugin the same way installClaude does and applies the checks that fit: with no plugin, the standalone hook files must all be present, unmodified, and wired; with the plugin, that wiring is the conflict rather than the requirement. Orphaned entries are reported either way since migrating between the two paths can strand them. Bare `node` invocations and a missing statusline are reported as notes, not problems, because the installer already migrates the former on re-run. Exits 1 when anything is wrong, 0 otherwise. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
caveman --doctor: a read-only report on an existing install. It never writes anything, so a broken install is diagnosed here and fixed by re-running the installer or--uninstall.Why
Half-broken installs are hard to diagnose today. A hook file deleted or edited by hand, a
settings.jsonthat stopped parsing after a manual edit, entries left behind pointing at scripts that no longer exist (#471), or standalone hooks still wired alongside the plugin so every event fires twice (#392). The symptom is a session that crashes at start, double-fires, or silently does nothing, and nothing tells the user which piece is wrong.How
Doctor probes for the plugin the same way
installClaudedoes (claude plugin list) and applies the checks that fit the mode it finds:checksums.sha256, and wired intosettings.json.Orphaned entries are reported in either mode, since migrating between the two paths in either direction can strand them. A user hook whose path merely contains a caveman-like name is never flagged, reusing the exact-basename rule the settings helpers already apply.
Bare
nodeinvocations and a missing statusline are reported as notes rather than problems: the installer already migrates the former on re-run, and neither breaks anything.Exits 1 when at least one problem was found, 0 otherwise. Honors
--config-dirand--no-color.Tests
19 tests in
tests/installer/doctor.test.mjscovering both install modes, including a fakeclaudebinary onPATHso the outcome never depends on what the machine running the suite happens to have installed, and a check that a broken install is left byte-for-byte untouched.npm testpasses 144/144 (125 existing + 19 new).🤖 Generated with Claude Code