Skip to content

feat(doctor): check a computer is set up for a brain (km 1.3.0) - #16

Merged
pasrom merged 2 commits into
mainfrom
feat/doctor
Oct 7, 2026
Merged

pasrom merged 2 commits into
mainfrom
feat/doctor

Conversation

@pasrom

@pasrom pasrom commented Oct 7, 2026

Copy link
Copy Markdown
Owner

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):

  • git installed, name and email set
  • origin reachable and readable; branch not behind it
  • uncommitted changes (note)
  • mounted brains from .gitmodules: reachable, checked out (note)
  • km version against the brain's pin (older fails, newer is a note)
  • plugins enabled in the brain's .claude/settings.json: installed for the user, for a project containing the brain, or synced by the organization; the fix names the marketplace from extraKnownMarketplaces when it is not known yet
  • uv: missing is a note, installed but off the PATH fails

Network 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 doctor start without it and tries python3, 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.

@pasrom
pasrom force-pushed the feat/doctor branch 3 times, most recently from 106d951 to d2093dc Compare October 7, 2026 19:00
pasrom added 2 commits October 7, 2026 21:43
`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.
@pasrom
pasrom merged commit 5989ae2 into main Oct 7, 2026
4 checks passed
@pasrom
pasrom deleted the feat/doctor branch October 7, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant