Documentation
How Repairo works
Install the CLI, diff OpenAPI contracts, map impact into TypeScript, JavaScript, Python, and Go, then open a reviewable PR — or run the same engine in the hosted workspace.
Overview & architecture
Repairo sits between vendor OpenAPI contracts and your application code. It classifies breaking changes, traces call sites, applies deterministic transforms where the spec change is unambiguous, and validates before anything merges.
The hosted product, demo, and GitHub App flows call runRepair() in src/lib/engine/index.ts. The repairo repair CLI uses the same diff → impact → generateFixes pipeline, then runs full-tree validateCodebase before --apply or --create-pr.
before/after OpenAPI → parseOpenApi → diffOpenApi → ApiChange[]
consumer files → findImpactedCode → ImpactMatch[]
optional agentResolve → resolveAmbiguousEnums
→ generateFixes
→ buildPullRequest (safetyScore)
→ validateInMemory (hosted) / validateCodebase (CLI)
→ RepairRunResult + SBOMQuickstart
- Try the browser demo
Open /demo to run OpenAPI diff → impact → patch → validation on bundled scenarios (no API keys).
- Scan a repo locally
Discover Stripe, OpenAI, Supabase, and other vendor usage in seconds.
- Diff and repair
Point at a new OpenAPI file, preview AST changes with compiler validation, then apply locally or open a GitHub PR.
Fixture walkthrough (clone this repo)
git clone https://github.com/adityacs50-lab/Repairo.git && cd Repairo
npm install
npx repairo-cli scan ./fixtures/consumers --vendors stripe
cp fixtures/breaking-api-demo/specs/old-openapi.json .repairo/snapshots/openapi.json
npx repairo-cli diff --spec ./fixtures/breaking-api-demo/specs/new-openapi.json --target ./fixtures/breaking-api-demoCLI installation
Requires Node.js 22+. No cloud account required for local scan, diff, and dry-run repair.
# One-off (no global install)
npx repairo-cli scan ./src --vendors stripe,openai,supabase
# Global install
npm install -g repairo-cli
repairo init --repo owner/your-app --vendors stripe,openai
repairo scan ./src
repairo check --vendors stripe,openai --target ./src
repairo repair --dry-run --target ./src
repairo repair --create-pr # git + GitHub token for PR creationPackage on npm: repairo-cli. Current engine version matches the site build.
Command reference
Run repairo --help for the full flag list.
| Command | What it does |
|---|---|
repairo scan [dir] | Discover third-party SDK and HTTP client usage. Options: --vendors stripe,openai,supabase |
repairo init | Create a local .repairo workspace. Options: --repo owner/name, --vendors … |
repairo check | Fetch live vendor OpenAPI, diff against snapshot, exit 1 on breaking changes. Options: --vendors, --target, --json, --update-snapshot |
repairo diff | Diff a spec file against your snapshot and map blast radius. Options: --spec, --target |
repairo repair | Generate compile-checked patches. Default --dry-run; use --apply or --create-pr when ready. Optional --agent-resolve for ambiguous enums (requires ANTHROPIC_API_KEY). |
Note
--agent-resolve is opt-in. It proposes enum mappings only when the diff is ambiguous; proposals still pass through deterministic transforms and compile checks. Repairo never auto-merges agent-assisted PRs.
OpenAPI diffing engine
Repairo parses before and after OpenAPI 3.x documents (and common 2.0 shapes), then classifies changes as breaking, additive, or safe — including path/method moves, required fields, enum renames, base URL / version bumps, and status-code shifts.
Impact mapping
For each classified change, Repairo traces likely call sites in TypeScript and JavaScript (ts-morph), Python, and Go (tokenizer-based, skipping comments and string literals). Output is a blast-radius summary: files, symbols, and severity.
Deterministic AST transforms
Patches are rule-based, not free-form LLM rewrites. Supported safe transforms include URL / base-path bumps, required field additions when a default is unambiguous, enum rename updates in string literals, and field or struct-tag renames. Ambiguous enum cases are flagged for human review unless --agent-resolve is enabled.
GitHub App
Install the Repairo GitHub App on repositories that store OpenAPI specs. On pull requests that touch a watched spec, Repairo diffs base vs head, posts a breaking-change summary, and can open a compile-verified fix PR when every transform is safe.
- Permissions: Contents read/write, Pull requests read/write, Metadata read
- Webhook events: Pull request, Installation
- Webhook URL: https://repairo-steel.vercel.app/api/github/webhooks
- Self-host: set APP_ID, PRIVATE_KEY, WEBHOOK_SECRET (see Deploy docs)
Hosted integrations
In the Repairo workspace, connect GitHub OAuth, pin vendor OpenAPI sources, and register repo webhooks that trigger repair runs when watched spec paths change on your default branch.
Supported vendors
- Stripe, OpenAI, Anthropic, Supabase, Google Gemini, GitHub REST
- Any custom OpenAPI 3.x / 2.0 schema via diff and snapshots
- Languages: TypeScript, JavaScript, Python, Go — same deterministic repair set
- Browse per-vendor agents at /agents
Code & data handling
Security expectations differ by surface — we document both honestly.
Info
Hosted /demo and /app: Spec and consumer files are fetched for a repair job, transformed in memory for that run, and not sold or used to train third-party models. See Security & trust and Privacy.
Note
Local CLI: repairo repair --apply and --create-pr write to your working tree or remote — by design. Use --dry-run to preview without touching disk.
GitHub OAuth scopes
The hosted workspace uses a GitHub OAuth App (not the GitHub App installation above). Scopes: repo (read specs, open PRs you request) and read:user (identity). Revoke anytime in GitHub → Settings → Applications.
Enterprise & compliance
Enterprise plans can include isolated runners and SSO (Entra ID, Okta). Formal SOC 2 / ISO programs are on the roadmap — see compliance roadmap or contact sales for a questionnaire.