Skip to content

lf doctor

Point-in-time environment health checks. Validates Node.js version, auth token, API reachability, BYOK key availability, Ollama connectivity, Docker presence (local mode), and journey RPC state.

bash
lf doctor                      # core checks (node, config, auth, API)
lf doctor --check byok         # which AI provider keys are available
lf doctor --check ollama       # Ollama server reachability
lf doctor --check auth         # token validity and user info
lf doctor --check journey      # fn_journey_state_get RPC availability
lf doctor --mode local         # add Supabase CLI + Docker to core checks
lf doctor --json               # structured JSON output

Checks

Check idWhen it runsPass condition
nodeAlwaysNode.js version is supported
supabase_cli--mode localSupabase CLI binary found
docker--mode localDocker daemon is running
project_configAlways.lenserfight.json exists in working dir
onboardingAlwaysOnboarding state is complete
authAlways / --check authStored token is valid; user email readable
cloud_apiAlways / --check api{cloudApiUrl}/health returns 2xx
journey_state--check journeyfn_journey_state_get RPC succeeds
ollama--check ollamaOllama server responds at configured URL
byok_*--check byokProvider key found in environment

Options

FlagTypeDescription
--modestringlocal or cloud. Defaults to project config mode.
--checkstringExtra targeted check: api, byok, ollama, auth, journey
--jsonbooleanEmit structured JSON result array

JSON output

json
{
  "mode": "cloud",
  "status": "passed",
  "checks": [
    { "id": "node",          "status": "pass", "detail": "v24.14.0" },
    { "id": "project_config","status": "pass", "detail": ".lenserfight.json present (mode=cloud)" },
    { "id": "auth",          "status": "pass", "detail": "Token valid — you@example.com" },
    { "id": "cloud_api",     "status": "pass", "detail": "https://api.lenserfight.com healthy" }
  ]
}

Failing checks include a code field with a typed error code for programmatic consumption:

json
{ "id": "node", "status": "fail", "detail": "v16.0.0 (requires >= 20)", "code": "NODE_VERSION_UNSUPPORTED" }

Available error codes: AUTH_NOT_CONFIGURED, API_UNREACHABLE, CONFIG_MISSING, NODE_VERSION_UNSUPPORTED, DOCKER_NOT_RUNNING, SUPABASE_CLI_MISSING, OLLAMA_UNREACHABLE, JOURNEY_RPC_UNAVAILABLE.

status is passed unless any check has status: "fail".


Troubleshooting quick-ref

SymptomCommand
Auth failslf auth login
Cloud API unreachableCheck LF_CLOUD_API_URL or run lf setup --mode cloud
Ollama not foundollama serve, then lf doctor --check ollama
No BYOK keys detectedSet ANTHROPIC_API_KEY, OPENAI_API_KEY, or equivalent
Docker not running (local mode)Start Docker, then lf doctor --mode local
Journey RPC failsMigration may not be applied — lf dev then retry

lf doctor

Validate environment health for local and cloud LenserFight flows.

FlagTypeRequiredDescription
--modestringnoCheck mode: local or cloud
--jsonbooleannoEmit structured JSON
--checkstringnoRun an additional targeted check: api, byok, ollama, auth, journey