RUNFIX V1.1 SPECIFICATION

Developer Documentation

Everything you need to integrate RunFix AI into your terminal workflow, IDE (Cursor, Windsurf, Claude Desktop), CI/CD pipelines, and cloud services.

STEP 01

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:

Terminal Commandbash
npx runfix "npm test"

2Apply the Synthesized Git Patch

RunFix returns a clean unified Git diff. Apply it directly with git:

Terminal Verificationbash
git apply patch.diff && npm test
STEP 02

Interactive Web Workbench

The RunFix Web Workbench at runfix.live provides a split-pane interface designed for rapid manual triage.

Interactive Presets
Instant 1-click test benches for Node.js, Python, Go, Rust, and Docker crashes.
Client-Side Scrubber Active
Secrets, passwords, and tokens are scrubbed in the browser before hitting the wire.
1-Click Patch Download
Export RFC 5322 formatted `.diff` patches directly to your disk or clipboard.
Bring Your Own Key (BYOK)
Input your private Anthropic, Gemini, or Groq API keys stored exclusively in localStorage.
STEP 03

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

CLI Commandsbash
# 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 --version

CLI Environment Variables

VariableDefaultDescription
RUNFIX_API_URLhttps://runfix.live/api/analyzeEndpoint URL for crash triage. Override for on-premise or custom gateways.
RUNFIX_API_KEYNone (optional)Private provider API key passed securely for dedicated tenant routing.
STEP 04

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

triage_stacktracetool

Pinpoint root cause of terminal error traces and synthesize a verified unified Git patch diff. Requires `errorLog`.

scrub_sensitive_datatool

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):

claude_desktop_config.jsonjson
{
  "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:

.cursor/mcp.jsonjson
{
  "mcpServers": {
    "runfix": {
      "command": "npx",
      "args": ["-y", "runfix", "mcp"]
    }
  }
}
STEP 05

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 CategoryExample Trigger PatternRedaction Token
Private Keys-----BEGIN RSA PRIVATE KEY-----[REDACTED_PRIVATE_KEY]
OpenAI API Keyssk-proj-9481ad8...[REDACTED_OPENAI_KEY]
Anthropic API Keyssk-ant-api03-8x7...[REDACTED_ANTHROPIC_KEY]
Google API KeysAIzaSyB8b3Z...[REDACTED_GOOGLE_KEY]
GitHub PAT / Tokensghp_9148b1..., github_pat_...[REDACTED_GITHUB_TOKEN]
AWS Access KeysAKIAIOSFODNN7EXAMPLE[REDACTED_AWS_KEY_ID]
DB Connectionspostgres://admin:pass@host/db[REDACTED_DB_PASSWORD]
JWT BearerBearer eyJhbGciOi...Bearer [REDACTED_JWT]
STEP 06

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:

.github/workflows/runfix-action.ymlyaml
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: true
STEP 07

REST API (`POST /api/analyze`)

Integrate RunFix programmatic triage into custom CLI bots, Datadog/Sentry webhooks, or internal dev tools.

cURL Request Examplebash
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

Response 200 OKjson
{
  "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"
  }
}
STEP 08

Supported Stacks & Runtimes

Node.js, TypeScript & React

Async unhandled promise rejections, TypeError null/undefined properties, Vite/Webpack build crashes, and React hydration mismatches.

Python & FastAPI

Pydantic 422 validation crashes, Django ORM tracebacks, Celery worker task exceptions, and SQLAlchemy session locks.

Go (Golang)

Concurrent map read and write panics, nil pointer dereferences, channel deadlocks, and goroutine leak traces.

Rust

Tokio worker thread bounds checks, vector index out-of-bounds panics, unwrap on None errors, and lifetime borrow checker diagnostics.

Docker & Linux Containers

Linux OOM Killer Exit Code 137, v8 JavaScript heap limit exhaustion, segfaults (Exit 139), and missing shared library loading failures.