Configuration

One layered, pydantic-validated config. Unknown keys are an error, not a silent typo.

This page is the reference — every key and its default. For what the keys mean — phases, attribution, denoising, matchers, budget, redaction — start with Concepts. ci-doctor ships no matchers: browse what a registry offers on matchers.cidoc.dev.

How layers combine

schema defaults  <  defaults.yml  <  user config  <  repo .ci-doctor.yml  <  CI_DOCTOR_* env  <  CLI flags

Mappings deep-merge; lists and scalars replace. So matchers.registries, a mapping, adds to the shipped official entry, while matchers.include, a list, replaces the one before it. A relative registry path resolves against the directory of the config file that names it; one set in an environment variable resolves against the working directory. Point at specific files with ci-doctor -f path/to/.ci-doctor.yml, before the command, repeated as often as you like — each one overrides the last.

The user config applies to every repo on the machine: ~/.config/ci-doctor/config.yml on Linux (or under $XDG_CONFIG_HOME), ~/Library/Application Support/ci-doctor/config.yml on macOS, %APPDATA%\ci-doctor\config.yml on Windows. It is where ci-doctor matchers add and the other editing commands write; ci-doctor --write-to .ci-doctor.yml matchers add … edits the repo file instead.

Inspecting the result

Config bugs are almost always a layer you forgot was applied. Ask:

ci-doctor config           # the effective config, every layer merged
ci-doctor config --diff    # only what your file/env/flags change vs the defaults
ci-doctor config --schema  # the JSON Schema, for editors and CI validation
ci-doctor config --validate            # the setup dry run: config, registries, matchers; exit 1 on a problem
ci-doctor -f base.yml -f ci.yml config # repeatable, the rightmost file wins
# Output pages through $PAGER on a terminal; ci-doctor --plain config prints raw (as does piping).

--diff reads like git diff: green is what your config adds, red is the default it replaced.

Editor completion

Every release ships ci-doctor.schema.json, generated from the same pydantic model that validates your file, so it can never drift. Point your editor at it:

# yaml-language-server: $schema=https://github.com/ci-doctor/ci-doctor/releases/latest/download/ci-doctor.schema.json
llm:
  model: qwen2.5-coder:32b

Environment variables

# Nested keys use a double underscore:
export CI_DOCTOR_LLM__MODEL="qwen2.5-coder:32b"
export CI_DOCTOR_LLM__API_BASE="http://vllm.internal:8000/v1"
export CI_DOCTOR_CI="github"

# Secret-looking single-underscore vars (e.g. CI_DOCTOR_GITLAB_TOKEN) are
# referenced by NAME (token_env) and ignored by the config loader.

Custom CA certificates

ci-doctor has no CA setting for the LLM or the matcher registries: each client trusts what its environment says, the way pip, uv and curl do. Point SSL_CERT_FILE (or SSL_CERT_DIR) at a bundle holding your internal CA and the public roots, usually the system one, such as /etc/ssl/certs/ca-certificates.crt. That covers the registry fetches and every LLM SDK built on httpx. Bedrock reads AWS_CA_BUNDLE instead. The GitLab and GitHub clients keep their own ca_bundle / verify_ssl keys below.

LLM backends

The LLM step is bring-your-own, via Pydantic AI. Pick one with llm.backend:

backendWhat it callsNeeds
openai (default)Any OpenAI-compatible endpoint (Ollama, vLLM, llama.cpp, internal gateway) or OpenAI itselfmodel + api_base; optionally openai.api: responses for the Responses API (default chat); pip install ci-doctorr[openai]
anthropicThe Anthropic Messages API directlymodel + api_key_env; pip install ci-doctorr[anthropic]
azureAzure OpenAImodel, azure.endpoint, azure.api_version, api_key_env; pip install ci-doctorr[openai]
bedrockAmazon Bedrock, AWS IAM auth (env vars, profile, or instance role) — not an API keymodel; aws.region or AWS_DEFAULT_REGION; pip install ci-doctorr[bedrock]
bedrock-mantleBedrock's OpenAI-shaped models, AWS IAM authmodel; aws (region optional); pip install ci-doctorr[bedrock-mantle]
googleThe Gemini APImodel; api_key_env or GOOGLE_API_KEY; pip install ci-doctorr[google]
google-cloudVertex AI, Google Cloud authmodel; gcp.project/gcp.location with Application Default Credentials, or an API key; pip install ci-doctorr[google]
groqGroq's own APImodel; api_key_env or GROQ_API_KEY; pip install ci-doctorr[groq]
mistralMistral's own APImodel; api_key_env or MISTRAL_API_KEY; pip install ci-doctorr[mistral]
cohereCohere's own APImodel; api_key_env or CO_API_KEY; pip install ci-doctorr[cohere]
xaixAI's Grok APImodel; api_key_env or XAI_API_KEY; pip install ci-doctorr[xai]
Reach for openai first. The OpenAI Chat Completions shape is what Ollama, vLLM, llama.cpp, Together, Groq, DeepSeek, Mistral and most others already speak; a provider with its own backend above (Groq, Mistral, Google, ...) talks to its native API instead. Keep openai.api on chat for self-hosted servers; only OpenAI itself and some gateways offer the newer Responses API. There is no default SDK in the base install any more — every backend needs its own extra, picked for exactly the provider you're using.
Only Pydantic AI's own providers. Every backend is a provider Pydantic AI ships itself, so the extras install side by side. Pydantic AI supports more providers than the ones listed here; ask for one you need. When the LLM is disabled or unavailable, ci-doctor emits the deterministic report instead of failing.
bedrock with no resolvable AWS credentials can probe the network at startup. Unlike the other backends, building the client eagerly resolves AWS credentials (env vars, profile, or instance metadata) — with none available anywhere, that resolution itself makes a request rather than failing instantly. Set AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY (or run with an instance role) so it never reaches that path.

Matchers

Evidence matchers are not written in this file. They live in registries, and the config only says where those are and what to load from them:

KeyDefaultWhat it does
matchers.registries{official: https://matchers.cidoc.dev/}Alias → the folder holding the registry's index.yaml. An alias is lowercase letters, digits, _ and -. Locations are listed below.
matchers.include[]Matchers and bundles to load, each alias/name. Nothing is selected by default, and an empty list exits 1.
matchers.exclude[]Outputs to drop from the included matchers, each alias/matcher.output (official/ruff.format). An entry that names no output of an included matcher exits 1.
matchers.timeout_seconds10Seconds to wait on each registry request before failing the setup. Raise it for a slow mirror.
matchers.fetch_workers8Registry files fetched at once, 1–32. Lower it for a registry that rate-limits.
matchers.cachetrueKeep fetched files from http(s):// registries, stored by the sha256 their index lists. A run revalidates each index (no request at all while the server's max-age holds) and fetches only files whose hash changed. Local registries are never copied.
matchers.cache_dirOS cache dir~/.cache/ci-doctor (or $XDG_CACHE_HOME), ~/Library/Caches/ci-doctor, or %LOCALAPPDATA%\ci-doctor\Cache. A relative path is relative to the working directory, so a CI cache step can keep it (.cache/ci-doctor).
LocationExample
A local path, relative to the config file./ci/matchers
file://file:///srv/matchers
https:// (http:// works, with a warning)https://matchers.cidoc.dev/

Every run reads the registries as they are now: there is no cache, no lock file and no version field. To pin one, point it at a URL that contains a fixed revision, such as a raw URL with a tag or commit SHA in it. Edit both keys by hand or with ci-doctor matchers, and check the result with ci-doctor config --validate.

Regex syntax

Every regex you can configure — a matcher's regex (and the regex a template becomes), denoise.noise_patterns, redaction.extra_patterns — is RE2, compiled when the config loads. RE2 matches in linear time, so no pattern can hang a job. What that rules out:

Full reference

Drop a .ci-doctor.yml at your repo root. Everything below is optional — every key has a default.

# .ci-doctor.yml — every knob, with defaults shown.
ci: github                       # which CI to read the run from (github | gitlab)
scm: null                        # which git host gets the note (defaults to "ci")

gitlab:
  base_url: https://gitlab.com   # default; override for a self-hosted instance
  api_version: v4
  token_env: CI_DOCTOR_GITLAB_TOKEN
  token_file: null               # e.g. /run/secrets/gitlab_token (wins over token_env)
  ca_bundle: null                # path to a custom/internal CA bundle
  verify_ssl: true
  timeout_seconds: 30
  limits:                        # caps that make a stuck API fail instead of hang
    max_pages: 100               # pages of one list (100 items each); past it the call fails
    rate_limit_retries: 3        # rate-limit waits before giving up; 0 fails on the first
    rate_limit_max_wait_seconds: 60  # a longer single wait fails at once

github:                          # used when github is the ci or the scm
  base_url: https://api.github.com     # default; override with a GHE base, e.g. https://ghe/api/v3
  token_env: CI_DOCTOR_GITHUB_TOKEN
  token_file: null
  ca_bundle: null
  verify_ssl: true
  timeout_seconds: 30
  limits:                        # same keys and defaults as gitlab.limits
    max_pages: 100
    rate_limit_retries: 3
    rate_limit_max_wait_seconds: 60

llm:
  enabled: true                  # false => deterministic-only report
  backend: openai                # openai | anthropic | azure | bedrock | bedrock-mantle | google |
                                 # google-cloud | groq | mistral | cohere | xai
  model: null                    # e.g. "qwen2.5-coder:32b" or "claude-opus-4-8"
  api_base: null                 # OpenAI-compatible base URL
  api_key_env: null              # optional; local servers often need none
  openai:
    api: chat                    # backend: openai; chat (Chat Completions) | responses (Responses API)
  azure: null                    # backend: azure; required there
  #   endpoint: https://<resource>.openai.azure.com
  #   api_version: "2024-10-21"
  aws: null                      # bedrock, bedrock-mantle; required there
  #   region: us-east-1          # optional; falls back to AWS_DEFAULT_REGION/AWS_REGION
  gcp: null                      # backend: google-cloud; required there
  #   project: my-project        # optional; falls back to the environment's
  #   location: us-central1      # optional; e.g. us-central1 or global
  max_input_tokens: 16000        # 70% is the log excerpt; lower for a small local model, raise for a hosted one
  temperature: 0.1
  timeout_seconds: 120           # wall-clock budget for one call, retries included
  max_retries: 1                 # SDK retries (not bedrock); Pydantic AI's own Agent retries once more on an invalid reply

analysis:
  include_allowed_failures: false   # allow_failure jobs are noise by default
  max_jobs_analyzed: 10
  max_parallel_jobs: 4              # jobs analyzed at once; 1 for a strictly sequential run
  skip_llm_for: [no_runner, missing_dependency, cancelled]  # fully-determined -> templated

phases:                          # section/step name -> phase (merged onto the shipped map)
  my_custom_deploy_section: script

matchers:
  registries:                    # alias -> registry folder (the one holding index.yaml)
    official: https://matchers.cidoc.dev/   # shipped; override it, or add your own:
    # acme: ./ci/matchers                   # a path, relative to this file
    # pinned: https://raw.githubusercontent.com/acme/matchers/<tag-or-sha>/
  include: []                    # alias/name of a matcher or bundle; empty exits 1
  # include: [official/python, acme/mytool]
  exclude: []                    # alias/matcher.output to drop; one that names nothing exits 1
  timeout_seconds: 10            # per registry request
  fetch_workers: 8               # registry files fetched at once; 1 fetches in order
  cache: true                    # keep http(s) registry files; a run fetches only what changed
  cache_dir: null                # default: the OS cache dir; relative to the working directory

extraction:
  tail_lines: 120                # lines kept from the end of the blamed section

denoise:
  collapse_carriage_returns: true   # collapse \r progress bars to their final state
  dedupe_repeats: true              # repeated lines -> "<line>  (×47)"
  noise_patterns:
    - '^\s*$'

output:
  terminal: true
  markdown_path: report.md
  json_path: report.json
  mr_note: false                 # post/update a note on the MR/PR (needs a live pipeline)

redaction:
  enabled: true
  extra_patterns: []             # additional regexes to scrub
base_url defaults to the public host (gitlab.com / api.github.com). Override it for a self-hosted GitLab or GitHub Enterprise instance. Custom CA bundles and proxies are honoured either way.