Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.refactron.dev/llms.txt

Use this file to discover all available pages before exploring further.

All Refactron CLI configuration lives in .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

FieldTypeDefaultDescription
transformsstring[]["all"]["all"] enables every transform, or list specific transform IDs.
excludestring[][]Gitignore-style globs to skip during analysis (e.g. ["dist", "node_modules"]).
testCmdstring | nullnull (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.
pythonVersionstring | nullnull (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.
dryRunbooleantrueDefault 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.modelstring"llama-3.3-70b-versatile"Model name passed to the provider.
documentation.endpointstring | nullnullOverride the provider URL (e.g. self-hosted Ollama or a custom OpenAI-compatible gateway).
documentation.tokenBudgetinteger (256-32000)4000Completion-token cap per LLM call. Also bounds docstring batch size, so the model’s JSON reply never overruns it.
documentation.redactPatternsstring[][]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.cachebooleantrueCache prompt → response under .refactron/cache/llm/. Bypass once with --no-cache.
documentation.maxConcurrencyinteger (1-32)4Maximum LLM requests in flight at once.
documentation.requestsPerMinuteinteger (1-10000)25Soft client-side cap on requests started per minute — paces bursts so they don’t trip provider 429s.
documentation.tokensPerMinuteinteger (500-10000000)200000Soft client-side cap on (estimated) tokens started per minute — the binding limit on most free tiers.
documentation.batchTokenBudgetinteger (500-64000)4000Source-token budget per batched docstring request. Bigger = fewer LLM calls, but each call costs more.

Example

{
  "$schema": "https://refactron.dev/schema/refactronrc.json",
  "transforms": ["all"],
  "exclude": ["node_modules", "dist", ".venv", "__pycache__"],
  "testCmd": null,
  "confidence": "high",
  "pythonVersion": "3.11",
  "dryRun": true,
  "documentation": {
    "provider": "backend",
    "model": "llama-3.3-70b-versatile",
    "endpoint": null,
    "tokenBudget": 4000,
    "redactPatterns": [],
    "cache": true,
    "maxConcurrency": 4,
    "requestsPerMinute": 25,
    "tokensPerMinute": 200000,
    "batchTokenBudget": 4000
  }
}

File search order

Refactron uses cosmiconfig and looks for, in order:
  1. .refactronrc
  2. .refactronrc.json
  3. .refactronrc.yaml
  4. refactron.config.js
The first match wins. We recommend .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 code 2 and a clear error message — no silent ignoring.