First run
Start with a saved log. Passing a log path instead of a run id runs the whole pipeline against it with no CI provider, no token and no LLM — the fastest way to see what the tool actually does.
Select matchers
ci-doctor ships no matchers, and a run with none selected exits 1. Add the
ones for the tools your jobs run from the official registry — browse them
at matchers.cidoc.dev, or with
ci-doctor matchers search:
# Pick matchers for your stack (writes .ci-doctor.yml), then check the setup:
ci-doctor matchers add official/python
ci-doctor config --validate
Each run reads the selected matchers from their registry, so it needs to
reach matchers.cidoc.dev, or a local copy — see Matchers.
Replay a saved log
# Save the log of a job that failed, then:
ci-doctor analyze failing-job.log
An existing path means no run is fetched, so this needs no token and no
model, only the .ci-doctor.yml from the step above. It is also the fastest way to test a .ci-doctor.yml or reproduce an attribution you disagree with.
Against a live run
# Against a live run (reads $CI_PIPELINE_ID / $GITHUB_REPOSITORY in CI):
ci-doctor analyze "$CI_PIPELINE_ID"
# From your laptop, with no CI variables set, the repo comes from your
# git origin — and it logs a warning naming what it picked:
ci-doctor analyze 123456
This one needs a read-scoped token — see Requirements.
What you get
- Terminal report — readable in the job log, collapsible inside GitLab CI, colour-aware.
-
report.md+report.json— job artifacts. The JSON includes a self-containedhandoff_promptyou can paste into a coding agent to perform the fix. -
MR/PR note — one idempotent comment, updated in place,
only when
output.mr_note: trueand confidence is medium or high.
╭─ ci-doctor ─────────────────────────────────────────────────╮
│ build failed in the script phase (script_failure). │
│ phase=script category=test confidence=high │
╰─────────────────────────────────────────────────────────────╯
Root cause
test_add asserted 1 == 2
Evidence
╭─ script ────────────────────────╮
│ E assert 1 == 2 │
╰─────────────────────────────────╯
Remediation
1. Inspect the failing assertion in tests/test_math.py
llm.enabled: false — or simply llm.model unset —
you still get the phase, the reason, the terminal command, the evidence and
remediation steps. The model only ever adds the prose explanation.
When the verdict looks wrong
Run it again with -v. The denoise → extract → fit line shows how many lines each stage kept and whether the budget had to
truncate, and the attribution line names the exact rule that fired. Both are
covered on
the CLI reference, and
Sections & attribution explains what those rule names mean.
Happy with it? Wire it into your pipeline →