All Refactron CLI configuration lives inDocumentation Index
Fetch the complete documentation index at: https://docs.refactron.dev/llms.txt
Use this file to discover all available pages before exploring further.
.refactronrc.json at your project root. Every field is optional — defaults are applied when a key is missing, and any key the CLI flag explicitly sets wins over the file.
Run refactron init to scaffold a starter file.
Schema
| Field | Type | Default | Description |
|---|---|---|---|
transforms | string[] | ["all"] | ["all"] enables every transform, or list specific transform IDs. |
exclude | string[] | [] | Gitignore-style globs to skip during analysis (e.g. ["dist", "node_modules"]). |
testCmd | string | null | null (auto-detect) | Override the test runner Gate 3 invokes. Auto-detection looks for vitest.config.*, jest.config.*, pytest.ini, or a [tool.pytest.*] block in pyproject.toml. |
confidence | "high" | "medium" | "low" | "high" | Minimum analyzer confidence to surface findings. Lower = noisier. |
pythonVersion | string | null | null (auto-detect) | Pin the Python target version for version-gated transforms (lru_cache_to_cache, pep585_generics, pep604_optional_union, datetime_utc_alias). Auto-detected from pyproject.toml’s requires-python (PEP 621) or [tool.poetry.dependencies] python when not set. Format: "3.9", "3.11", etc. When null and not detectable, version-gated transforms refuse with python_version_too_low rather than guess. |
dryRun | boolean | true | Default mode for run when neither --apply nor --dry-run is passed. |
documentation.provider | "backend" | "ollama" | "openai" | "anthropic" | "groq" | "backend" | LLM provider for the document command. "backend" uses your stored Refactron credentials (Pro plan); the others are opt-in. |
documentation.model | string | "llama-3.3-70b-versatile" | Model name passed to the provider. |
documentation.endpoint | string | null | null | Override the provider URL (e.g. self-hosted Ollama or a custom OpenAI-compatible gateway). |
documentation.tokenBudget | integer (256-32000) | 4000 | Completion-token cap per LLM call. Also bounds docstring batch size, so the model’s JSON reply never overruns it. |
documentation.redactPatterns | string[] | [] | Extra regex patterns to strip from prompts before they leave your machine. The built-in set already covers AWS keys, OpenAI / Anthropic / GitHub tokens, JWTs, and generic .env style assignments. |
documentation.cache | boolean | true | Cache prompt → response under .refactron/cache/llm/. Bypass once with --no-cache. |
documentation.maxConcurrency | integer (1-32) | 4 | Maximum LLM requests in flight at once. |
documentation.requestsPerMinute | integer (1-10000) | 25 | Soft client-side cap on requests started per minute — paces bursts so they don’t trip provider 429s. |
documentation.tokensPerMinute | integer (500-10000000) | 200000 | Soft client-side cap on (estimated) tokens started per minute — the binding limit on most free tiers. |
documentation.batchTokenBudget | integer (500-64000) | 4000 | Source-token budget per batched docstring request. Bigger = fewer LLM calls, but each call costs more. |
Example
File search order
Refactron uses cosmiconfig and looks for, in order:.refactronrc.refactronrc.json.refactronrc.yamlrefactron.config.js
.refactronrc.json for editor JSON-schema support.
Validation
Configs are validated against a JSON Schema 7 schema with Ajv 8. Unknown fields, wrong types, and out-of-range values cause the CLI to exit with code2 and a clear error message — no silent ignoring.