Splat is an AI-powered debugging CLI tool that automatically analyzes runtime errors, builds context from your codebase, and provides intelligent fixes. The system combines error parsing, dependency analysis, and LLM-powered code understanding to deliver actionable debugging insights.
When an error occurs, Splat extracts all file paths mentioned in the traceback:
utils/utils.py
def parse_error_stack(error_info: str) -> List[str]: files = [] # This regex looks for file paths in various formats file_pattern = re.compile(r'(?:File "([^"]+)"|\b(\S+\.py)\b)') for line in error_info.split('\n'): matches = file_pattern.findall(line) for match in matches: file_path = next((m for m in match if m), None) if file_path: file_path = file_path.strip().strip('\'\'"') if os.path.exists(file_path): files.append(file_path) return list(dict.fromkeys(files))
The regex pattern handles both quoted paths (File "path.py") and unquoted paths (path.py) commonly found in error tracebacks.
Results are displayed using an interactive prompt:
terminalout/terminal.py
def terminalstep1(json_object): data = json.loads(json_object) print_formatted_text(HTML("🔎 <u><b>Details about error</b></u>")) print_formatted_text(HTML(f"✅ Error at line {data['where']['line_number']}")) print_formatted_text(HTML(f"✅ File: {data['where']['file_name']}")) print_formatted_text(HTML(f"✅ Type: {data['what']['error_type']}"))
Users can navigate with arrow keys to accept or reject the suggested fix.