1 — Install
2 — Authenticate (one-time)
Refactron needs an account to runanalyze, run, and document.
~/.refactron/credentials.json. You won’t need to log in again on this machine.
For CI or headless environments, skip the browser: open your Refactron dashboard, go to API Keys, and click Create Key. The key authenticates the CLI the same way a login session does.

REFACTRON_TOKEN environment variable:
analyze, run, and document all read REFACTRON_TOKEN when it is set, so no refactron login step is needed in CI.
3 — Analyze
From your project root:
analyze reports every finding as an auto-fix candidate — it never runs a
transform, so run --dry-run is the source of truth for what actually changes.
4 — Preview the refactor
5 — Apply with verification
6 — Document the refactor (optional)
run --apply and writes docstrings, inline comments, a CHANGELOG entry, and a modernization report under docs/refactron/.
This is the one step that uses an LLM, and it runs only on the already-verified diff — the worst case is a wrong sentence, never broken code. It needs an LLM provider configured (managed backend, Ollama, OpenAI, Anthropic, or Groq) — see .refactronrc.json → documentation.
Made a change you want to undo?
refactron rollback reverts the last run --apply or document --apply — a drift-safe LIFO undo. See the CLI reference.Next steps
- Scope a refactor to specific transforms: see the transform catalog
- Configure thresholds + exclusions: see
.refactronrc.json - Understand the guarantees: The 3-Gate Safety Model