Repository navigation
feat(doctor): check a computer is set up for a brain (km 1.3.0) - #16
Merged
Merged
Conversation
pasrom
force-pushed
the
feat/doctor
branch
3 times, most recently
from
October 7, 2026 19:00
106d951 to
d2093dc
Compare
`km doctor` lists, one line per check, what this computer still lacks to work on the brain, each failure with its fix: git and its name and email, access to the origin and whether the branch lacks changes that are on it, the mounted brains, the km version against the brain's pin, the plugins the brain's .claude/settings.json enables (installed for the user, for a project the brain lies in, or synced by the organization), and whether km can run at all (uv, or a Python with PyYAML). Everything expected is read from the brain or from git's and Claude Code's own files, so km carries no host, organization or plugin names. Network checks run without prompts (GIT_TERMINAL_PROMPT=0, GCM_INTERACTIVE=never, empty askpass so an editor's password box cannot open, ssh BatchMode), in the C locale so git's messages can be told apart, and with a 15 s limit: a missing login on a private repository fails instead of waiting for a password. Printed URLs drop a user or token. Relative submodule URLs are resolved against origin, and submodule names may hold spaces. A hand-edited JSON file with odd values is read as empty, not a crash. Uncommitted changes, a mounted brain not checked out and a km newer than the pin are notes, not failures. The fix for a branch behind or diverged from origin is a pull with rebase from the named branch, which works without tracking information. `paths.git` returns exit code 127 instead of raising when git is missing, so km doctor (and every other command) says so instead of a traceback; it also takes env and timeout. The check imports no PyYAML, and the launcher lets `doctor` start on a Python without it, trying python3, python and `py -3` (on Windows `python3` is often the Store's placeholder). The launcher also finds uv in ~/.local/bin, where its installer puts it, before an app restart has put that folder on the PATH; and when nothing can run km it says so in plain words with the one-line uv install for Windows and for macOS/Linux, and whether git is missing too. The skill gains a setup-check section: check git first, run km doctor, offer to install uv and the other safe fixes, hand over the rest in plain words.
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.
Adds
km doctor: one line per check of what this computer still lacks to work on a brain, each failure with its fix. Aimed at people who are not developers; the skill gains a setup-check section ("check my setup") that runs it and explains the result in plain words.Checks, all reading their expected values from the brain or from git's and Claude Code's own files (no host, organization or plugin names in km):
.gitmodules: reachable, checked out (note).claude/settings.json: installed for the user, for a project containing the brain, or synced by the organization; the fix names the marketplace fromextraKnownMarketplaceswhen it is not known yetNetwork checks run without prompts and with a 15 s limit, so a missing login fails instead of hanging. ASCII output for cp1252 consoles. No PyYAML needed; the launcher lets
doctorstart without it and triespython3,python,py -3.Tests:
tests/doctor_smoke.sh(18 cases, in the smoke and Windows jobs); each behaviour case was mutation-checked to fail without its code. The other smoke tests pass unchanged.Second commit is the 1.3.0 release bump; merging releases it.