Skip to main content

Quick Start

Splat is designed to be simple: just prefix your normal run command with splat squash. When your code encounters an error, Splat captures it, analyzes the context, and provides an AI-powered fix.

Basic Syntax

splat squash "<your-normal-command>"
Splat works with any language or framework - just run your code the way you normally would.

Python Examples

Fixing a Syntax Error

def hello():
    print("hello"
if __name__ == "__main__":    hello()
The error was a missing closing parenthesis in the print statement. Splat detected it, suggested the fix, and applied it automatically.

FastAPI Runtime Errors

from fastapi import FastAPI
from pydantic import BaseModel

app = FastAPI()

class Item(BaseModel):
    id: int
    name: str
    price: float

items = [
    Item(id=1, name="Laptop", price=999.99),
    Item(id=2, name="Phone", price=499.99),
]

@app.get("/items")
async def get_items():
    # Returns wrong types - causes validation error
    return [{"id": "not_an_int", "name": item.name, "price": str(item.price)} for item in items]

JavaScript Examples

Const Reassignment Error

const num = 42;

function faultyFunction() {
  num = 10; // Attempt to reassign a constant
  console.log(num);
}

faultyFunction();

React JSX Syntax Error

function App() {
  return (
    <div className="App">
      <header className="App-header">
        <img src={logo} className="App-logo" alt="logo"
        <p>Edit <code>src/App.js</code> and save to reload.</p>
      </header>
    </div>
  );
}

Java Examples

Missing Return Statement

public class FaultyJava {
    public static void main(String[] args) {
        System.out.println("The result is: " + faultyMethod());
    }

    public static int faultyMethod() {
        int a = 5;
        int b = 10;

        if (a < b) {
            System.out.println("a is less than b");
        }
        // Missing return statement
    }
}

Expected Output

When Splat successfully fixes an error, you’ll see:
 Analyzing error stack trace...
 Gathering context from error files...
 Generating fix with AI...

 Error: <error type and message>
 File: <file_path>:<line_number>

 Suggested Fix:
  <clear explanation of what was wrong>
  <what change was made>

 Fix applied successfully!
 Your code is now running without errors.

Tips for Basic Usage

Always run Splat from your project root directory for best results.
Splat respects your .gitignore file and won’t access sensitive files or directories.
For more complex errors involving multiple files and dependencies, use the -r flag for relational mode. See Relational Mode for details.

Next Steps

Build docs developers (and LLMs) love