Spark is a single TypeScript file — 2 700 lines you can read, audit, and trust. Every tool an agent needs to get real coding work done is built in. No framework, no magic, no hidden runtime.
bun spark.ts --autopilot "fix the login 500 and add a test"
The entire agent is spark.ts. No installed packages, no separate runtime, no build step. Read it once — you know everything the agent can do.
ReadFile, WriteFile, Bash, Eval, Glob, Grep, FindSymbol, Task — eight tools that cover every real-world coding task. Nothing missing, nothing extra.
Auto-picks the best Ollama model on your machine. Or point OPENAI_BASE_URL at any OpenAI-compatible API. Your keys, your hardware.
Every tool the agent needs — all inside spark.ts. No plugins to install.
Read files with offset + limit. Never loads more than needed.
Full write or surgical patch mode. Targeted string replacement inside a file.
Run any shell command with configurable timeout. Build, test, deploy.
JS/TS REPL — execute code in-process and get the result back.
Fast file pattern matching. Respects .gitignore.
Regex search across the codebase with file + line results.
Jump to any function, class, or variable definition instantly.
Spawn concurrent subagents. Fan out work, collect results in parallel.
Pass a goal and walk away. Spark drives to completion — up to 50 reflection steps — and only exits when done.
# Fix a bug, end-to-end bun spark.ts --autopilot "the login form shows a 500 on submit, investigate and fix"
The Task tool spawns concurrent sub-agents. Fan out work across multiple files or modules, then collect results with WaitTask.
Long sessions automatically compact the context when it nears the model limit. Runs stay coherent without manual intervention.
Spark reads your git status and recent log at session start — the model knows what branch you're on and what changed.
Drop an AGENTS.md in your repo root. Spark loads it as system context — project conventions, forbidden paths, custom tool hints.
Auto-discovers Ollama models, scores them by capability and parameter count, and picks the best one. Override with --model.
Clone the repo or copy the file. Run with bun spark.ts. Bun and an LLM endpoint are the only dependencies.
One file. No magic. Every tool needed to ship real code — locally or against any OpenAI-compatible API.
Clone and run. Bun + Ollama is all you need.
git clone github.com/dzianisv/spark bun spark.ts