CLI reference
doctor
CLI reference for the apothem doctor command.
Check the health of what is installed. Where
apothem verify checks the harnesses you select,
doctor checks every installed harness and the shared profile in one pass.
Synopsis
apothem doctor [--project PATH] [--quiet|-q] [--verbose|-v]
[--format plain|json] [--json] [--no-color]What it checks
- Shared profile. A present profile is validated against the packaged
schema; a malformed one fails with its diagnostic code. A missing profile is
reported, not failed (
installcreates one). - Installed harnesses only. A harness that is not installed is reported as
not_installedand is not a failure, so a machine with one healthy harness passes. Project-scope harnesses are checked when--projectnames their root; without it they are reported asneeds_project. - Verify. Each installed harness must pass the same check as
verify. - Hook runtime. For each verified harness, doctor reads the files its latest
install wrote, finds the hook commands Apothem registered there, and starts
each interpreter and hook script once with a no-op payload (the registered
arguments plus
--help,{}on stdin, a scratch working directory, andPYTHONPATHremoved). Nothing is written. A missing interpreter, a missing script, or a crash at import time fails the check.
Every failed check names a fix. Exits 0 when no check fails and 1 otherwise.
JSON output
--json keeps the earlier fields (version, python, platform,
profile_path, profile_exists, profile_valid, harnesses, all_ok,
and profile_error when the profile is invalid) and adds:
profile_error_code— the profile diagnostic code, when the profile is invalid.project— the resolved--projectroot, ornull.harnesses[].status—ok,not_installed,needs_project,verify_failed,hook_failed, orerror; plusverifiedandhooks({"probed": N, "failed": [...]}, ornullwhen no install record exists).checks— one record per check:code(for exampleharness.verify_failed,hook.start_failed,ledger.unreadable, or aprofile.*code),status(pass,fail, orinfo),harness,message, andfix.
{
"schema_version": 1,
"all_ok": false,
"checks": [
{
"code": "hook.start_failed",
"status": "fail",
"harness": "claude-code",
"message": "claude-code: a registered hook command cannot start: …",
"fix": "Check that the interpreter in the hook command exists and runs, then …"
}
]
}Options
| Option | Description |
|---|---|
--project PATH | Project root for project-scope harnesses; without it they are reported as needs_project. |
--quiet, -q | Suppress informational output; only errors are emitted. |
--verbose, -v | Accepted for consistency with other commands; this command prints no extra output. |
--format plain|json | Output format (default: plain). |
--json | Shorthand for --format json. |
--no-color | Disable ANSI color codes in output. |
-h, --help | Show help and exit. |
Examples
apothem doctor
apothem doctor --project .
apothem doctor --jsonThe default plain format prints human-readable diagnostics; --json
(equivalent to --format json) emits a machine-readable document on stdout,
suitable for piping into other tooling.
Exit codes
| Code | Meaning |
|---|---|
| 0 | All checks passed (also when no harness is installed yet) |
| 1 | An installed harness does not verify, a registered hook command cannot start, an adapter could not be loaded or probed, or a present profile failed schema validation |
| 64 | Usage error: an unknown option or command, or a missing or invalid option value. Under --json the error is a JSON envelope with code cli.usage. |
See also
- apothem harnesses — list and inspect registered harnesses
- apothem verify — verify a harness adapter installation