rafiki doctor is a local readiness check for the Node CLI, Python generation
stack, MCP server, provider keys, and HTML rendering path.
Run it from the repo root:
npm run doctoror through the CLI:
npx rafiki --doctor- Node.js version.
- Core Node dependencies for the CLI:
commander,dotenv, andchalk. - Python executable, preferring
.venvunlessRAFIKI_DOCTOR_PYTHONis set. - Core Python dependencies for generation:
python-dotenv,google-genai,openai,pillow,pyyaml, andtenacity. .envpresence. This is useful but optional because shell environment variables work too.- Provider keys without printing secret values:
GOOGLE_API_KEYfor Gemini andOPENAI_API_KEYfor OpenAI image generation. - MCP availability:
mcp_server.pyexists, compiles, and theFastMCPSDK can import. - Browser rendering readiness:
puppeteerandsharpcan load, and Rafiki can find either a configured Chrome/Chromium path or Puppeteer's managed browser.
Doctor prints [ok], [warn], and [fail] lines.
Warnings do not fail the command. Missing provider keys, a missing .env, MCP
setup gaps, or browser-rendering gaps are actionable warnings because dry-run,
review, and other local workflows may still be usable.
Failures exit non-zero. Today those are reserved for the critical local runtime: core Node CLI dependencies, Python itself, or core Python generation dependencies.
Install Node dependencies:
npm installInstall Python dependencies:
python3 -m venv .venv
.venv/bin/python -m pip install -r requirements.txtOptional .env setup:
cp .env.example .envThen edit .env, or skip the file and export provider keys in your shell.
Provider keys are warnings, not critical failures, because dry-run, render, and
review workflows can still run without them.
GOOGLE_API_KEY=...
OPENAI_API_KEY=...Repair browser rendering:
npm installIf doctor says puppeteer or sharp is missing or cannot load, fix Node
packages first. If those packages load but no browser is found, install
Chrome/Chromium, set PUPPETEER_EXECUTABLE_PATH=/path/to/chrome, or run:
npx puppeteer browsers install chrome