Developer Documentation
Everything you need to integrate RunFix AI into your terminal workflow, IDE (Cursor, Windsurf, Claude Desktop), CI/CD pipelines, and cloud services.
Quickstart Guide
Get from crash to verified fix in under 10 seconds. You can run RunFix from your browser, terminal, or IDE without creating an account.
1Direct Terminal Execution (No Installation Required)
Prepend `npx runfix` to your standard test or build command:
npx runfix "npm test"2Apply the Synthesized Git Patch
RunFix returns a clean unified Git diff. Apply it directly with git:
git apply patch.diff && npm testInteractive Web Workbench
The RunFix Web Workbench at runfix.live provides a split-pane interface designed for rapid manual triage.
Terminal CLI (`runfix`) Reference
The official RunFix CLI wraps any command execution, monitors exit codes, captures standard error output, scrubs secrets, and queries the triage engine.
Usage Modes
# 1. Wrap and monitor any command:
npx runfix "npm test"
npx runfix "pytest tests/"
npx runfix "cargo build"
npx runfix "go test ./..."
# 2. Pipe standard error directly:
cat crash.log | npx runfix
git log -1 --stat | npx runfix
# 3. Model Context Protocol (MCP) stdio server:
npx runfix mcp
# 4. View help and version:
npx runfix --help
npx runfix --versionCLI Environment Variables
| Variable | Default | Description |
|---|---|---|
| RUNFIX_API_URL | https://runfix.live/api/analyze | Endpoint URL for crash triage. Override for on-premise or custom gateways. |
| RUNFIX_API_KEY | None (optional) | Private provider API key passed securely for dedicated tenant routing. |
Model Context Protocol (MCP) Server
RunFix includes an official Model Context Protocol (MCP) server operating over stdio (JSON-RPC 2.0). Connect it to your AI coding environments like Claude Desktop, Cursor, and Windsurf to give your agent native error-fixing superpowers.
Tools Exposed by RunFix MCP
Pinpoint root cause of terminal error traces and synthesize a verified unified Git patch diff. Requires `errorLog`.
Sanitize API keys, tokens, credentials, and passwords from error logs prior to external sending.
Claude Desktop Configuration
Add this block to your Claude Desktop config file (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json, Windows: %APPDATA%\Claude\claude_desktop_config.json):
{
"mcpServers": {
"runfix": {
"command": "npx",
"args": ["-y", "runfix", "mcp"],
"env": {
"RUNFIX_API_URL": "https://runfix.live/api/analyze"
}
}
}
}Cursor IDE Configuration
Add to your project’s .cursor/mcp.json or global Cursor Settings:
{
"mcpServers": {
"runfix": {
"command": "npx",
"args": ["-y", "runfix", "mcp"]
}
}
}Client-Side Secret & PII Scrubber
RunFix contains an embedded sanitization engine that scrubs credentials in the browser or terminal before any HTTP payload leaves your machine.
| Target Category | Example Trigger Pattern | Redaction Token |
|---|---|---|
| Private Keys | -----BEGIN RSA PRIVATE KEY----- | [REDACTED_PRIVATE_KEY] |
| OpenAI API Keys | sk-proj-9481ad8... | [REDACTED_OPENAI_KEY] |
| Anthropic API Keys | sk-ant-api03-8x7... | [REDACTED_ANTHROPIC_KEY] |
| Google API Keys | AIzaSyB8b3Z... | [REDACTED_GOOGLE_KEY] |
| GitHub PAT / Tokens | ghp_9148b1..., github_pat_... | [REDACTED_GITHUB_TOKEN] |
| AWS Access Keys | AKIAIOSFODNN7EXAMPLE | [REDACTED_AWS_KEY_ID] |
| DB Connections | postgres://admin:pass@host/db | [REDACTED_DB_PASSWORD] |
| JWT Bearer | Bearer eyJhbGciOi... | Bearer [REDACTED_JWT] |
Autonomous GitHub Action CI Healer
Integrate RunFix directly into GitHub Actions to heal broken builds automatically. When a workflow fails, the action extracts the failed step log, synthesizes a patch, and opens an actionable Pull Request.
Save this workflow file to .github/workflows/runfix-action.yml in your repository:
name: "RunFix AI Autonomous Healer"
on:
workflow_run:
workflows: ["CI", "Test", "Build"]
types: [completed]
jobs:
auto-heal:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_branch }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Fetch Failed Step Logs & Triage via RunFix AI
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUNFIX_API_URL: "https://runfix.live/api/analyze"
run: |
echo "Inspecting failed workflow run: ${{ github.event.workflow_run.id }}"
gh run view ${{ github.event.workflow_run.id }} --log-failed > failed_trace.log || true
if [ -s failed_trace.log ]; then
echo "Invoking RunFix AI triage engine..."
npx runfix < failed_trace.log > runfix_diagnosis.json || true
fi
- name: Apply Patch and Open Pull Request
uses: peter-evans/create-pull-request@v6
with:
commit-message: "fix(ci): automated patch synthesized by RunFix AI"
title: "🤖 [RunFix AI] Automated Fix for failed CI run #${{ github.event.workflow_run.run_number }}"
body: |
## Automated Crash Healing Report
RunFix AI detected a workflow failure on branch `${{ github.event.workflow_run.head_branch }}`.
- **Root Cause Pinpointed**: Analyzed via multi-engine fallback.
- **Unified Patch**: Synthesized and applied cleanly.
- **Verification Status**: Ready for review and merge.
*Powered by [RunFix AI](https://runfix.live) (RunFix).*
branch: "runfix/auto-fix-${{ github.event.workflow_run.run_number }}"
delete-branch: trueREST API (`POST /api/analyze`)
Integrate RunFix programmatic triage into custom CLI bots, Datadog/Sentry webhooks, or internal dev tools.
curl -X POST https://runfix.live/api/analyze \
-H "Content-Type: application/json" \
-d '{
"errorLog": "TypeError: Cannot read properties of undefined (reading '''map''')\n at UserProfileList (src/components/UserProfileList.tsx:42:28)",
"provider": "anthropic",
"model": "claude-frontier"
}'JSON Response Format
{
"success": true,
"data": {
"rootCause": "The 'users' collection is asynchronously populated. On initial mount before resolution, 'users' evaluates to undefined. Invoking map causes an unhandled TypeError.",
"targetFile": "src/components/UserProfileList.tsx",
"diff": "@@ -40,3 +40,3 @@\n- return users.map(u => <UserCard key={u.id} user={u} />);\n+ return (users ?? []).map(u => <UserCard key={u.id} user={u} />);\n",
"latency": 342,
"provider": "ANTHROPIC",
"model": "claude-frontier"
}
}Supported Stacks & Runtimes
Async unhandled promise rejections, TypeError null/undefined properties, Vite/Webpack build crashes, and React hydration mismatches.
Pydantic 422 validation crashes, Django ORM tracebacks, Celery worker task exceptions, and SQLAlchemy session locks.
Concurrent map read and write panics, nil pointer dereferences, channel deadlocks, and goroutine leak traces.
Tokio worker thread bounds checks, vector index out-of-bounds panics, unwrap on None errors, and lifetime borrow checker diagnostics.
Linux OOM Killer Exit Code 137, v8 JavaScript heap limit exhaustion, segfaults (Exit 139), and missing shared library loading failures.