๐ฆ Sparrow
A local-first Rust agent cockpit โ route, run, replay, rewind.
One event stream. Terminal UI, WebView cockpit, JSON output, or gateway โ your choice.
Quick Start ยท Why Sparrow ยท Commands ยท Architecture ยท Docs ยท Releases
Sparrow is a single-binary CLI agent written in Rust. It routes each task to the cheapest capable model, keeps you in control with Git-backed checkpoints, and makes every run replayable. Local models (Ollama) are always the first hop; cloud providers are explicit fallbacks.
The project focuses on a narrow product promise: a Rust-native local cockpit where every run is visible, replayable, budgeted, and checkpointed.
Why Sparrow vs Claude Code / Codex / Aider
| Capability | Claude Code | OpenAI Codex CLI | Aider | Sparrow |
|---|---|---|---|---|
| Single static binary, no Node/Python runtime | โ | โ | โ | โ |
| Choose any provider, any model | โ Anthropic | โ OpenAI | โ | โ 38 providers |
| Local-first (Ollama OOTB) | โ | โ | โ ๏ธ | โ |
Git checkpoints + rewind per run |
โ | โ | โ ๏ธ | โ |
Budget caps (--max-cost-usd / --max-wall-secs) |
โ | โ | โ | โ |
| WebView cockpit + TUI + JSON stream | โ ๏ธ TUI only | โ ๏ธ TUI only | โ ๏ธ TUI only | โ all three |
| MCP server host + client | โ | โ ๏ธ | โ | โ |
Drop-in import of ~/.claude/ config |
n/a | โ | โ | โ |
| Multi-agent swarm (Planner โ Coder โ Verifier) | โ | โ | โ | โ |
| Telegram / Discord / Slack gateways | โ | โ | โ | โ |
| Pre-commit secret scanner bundled | โ | โ | โ | โ |
Voice (speak, transcribe) |
โ | โ | โ | โ |
| Replay & share session as URL/Gist | โ | โ | โ | โ |
| Source open, MIT | โ ๏ธ closed | โ ๏ธ closed | โ | โ |
| Zero telemetry by default | โ ๏ธ | โ ๏ธ | โ | โ |
See docs/comparison/vs-competitors.md for the long form (incl. OpenCode, Hermes, Continue, Cursor).
โจ What's New โ v0.6.2
Cockpit polish โ TUI status header no longer truncates cost/tokens/autonomy on 80-column terminals, and the render path now ships with headless test coverage. (v0.6.1: full skill catalog injected into system prompt so agents discover all 105 skills; agent creator modal centered; console layout fixes.)
WebView cockpit
- Compact swarm โ idle agents show icon + name + 1-line status; active triad expands. Sub-agents auto-appear as lanes.
- Tiered approvals โ inline card with 4 buttons: once / session / always / deny. "always" persists to permissions. Folds to a one-liner after decision.
- Agent creator โ "๏ผ new agent" button opens full form (name/role/model/color/tools/soul), writes
.soul.toml+.agent.mdinstantly. - Config panel v2 โ 6 tabs: providers, routing, permissions, appearance, memory & telemetry, MCP & hooks.
- Skills tab โ left rail now exposes the local skill library (was missing).
TUI
- Rich splash screen on boot โ formatted demo with code blocks, colored diffs, and JSON preview so users see rendering quality immediately.
- Agent toggle โ
@nova+ Tab switches full pipeline identity; gold indicator in status bar. - Auto-detected content formatting โ code, diffs, JSON, and markdown rendered with syntax colors in the scroll area.
CLI
- 20 new tools including web_search (DuckDuckGo/SearXNG, no API key), code_exec (sandboxed python/js/bash/ruby), browser/vision (Playwright).
- 105 skills with rich content โ debug-systematically, write-tests, code-review, docker, k8s, terraform, postgres, redis, API design, security audit.
- FTS5 session search โ
sparrow sessions search "query"with relevance-ranked snippets. - 5 cron job presets โ health check, auto-commit, security audit, session cleanup, knowledge distillation.
Install & distribution
cargo install sparrow-cliv0.6.2 on crates.io.- Homebrew tap, Scoop bucket, winget manifests with cross-compiled binaries.
sparrow launchโ first-run wizard auto-detects 20+ provider keys, ranks by cost tier, offers free fallbacks.sparrow demoโ 30-second snake game live coding demo.
What was already here (v0.5.x)
- Agentic engine with planner โ coder โ verifier pipeline, swarm orchestrator, git checkpoints + rewind.
- CLI rich rendering (syntect), streaming + chat composer, TTS/STT, voice commands.
- Memory CLI + FTS5 session search, encrypted credential store, pre-commit secret scanner.
- Humanized French errors, VS Code extension, Claude Code drop-in compat.
Why Explore It
| Model routing | Budget-aware fallback chains across Ollama, NVIDIA, Anthropic, OpenAI-compatible APIs, and 30+ registry entries |
| WebView cockpit | Live route/token/cost/context at http://127.0.0.1:9339/ with drawer panels, slash palette, and agent picker |
| Terminal-native | Animated TUI cockpit, sparrow run, sparrow chat, --json output, replay, memory, gateway |
| Rollback safety | Auto-checkpoint before any mutating action; sparrow rewind <id> to restore |
| Persistent context | SQLite facts + knowledge graph, SOUL-style .agent.md files, guarded skill registry, full transcripts |
| Browser/computer-use | Playwright-backed browser tool and gated screenshot/click/type computer primitive |
| Gateway | Telegram, Discord, Slack, WebSocket API โ wired with honest errors, not silent failures |
Status
Sparrow is public beta with a green cross-platform CI baseline. The kernel, routing core, console surfaces, replay, checkpoints, and memory are wired and tested; external transports are being validated by early adopters.
| Area | Status | Evidence |
|---|---|---|
| CI / Rust build | โ Stable | Ubuntu ยท macOS ยท Windows; fmt, clippy -D warnings, check, release builds |
| Test suite | โ Stable | Full cargo test green on current master |
| Security audit | โ Stable | rustsec/audit-check on all three platforms |
| Engine loop | โ Stable | Event stream, task classification, fallback execution, auto-checkpoint, auto-compaction |
| WebView console | โ Stable | Full cockpit โ rail/drawer, typed event stream, compact highlighted code cards, themes, composer, approval modal |
| TUI cockpit | โ Stable | Animated cockpit, swarm lanes, checkpoint/diff/cost panels, @ picker, history |
| Plan mode / slash | โ Stable | sparrow plan, /plan, built-in commands, user/project Markdown discovery |
| Permissions / hooks | โ Stable | 6 permission modes; Pre/Post lifecycle hooks for run/tool/checkpoint/compact |
| Declarative agents | โ Stable | SOUL TOML + Markdown frontmatter; agent run, agent mention, CRUD |
| Skills / plugins | โ Stable | Progressive references + templates; plugin manifests; CLI install/list/remove |
| Toolsets | โ Stable | Toolset/risk/auth/mutation/network/exec metadata; surface filtering |
| Browser / computer-use | ๐ถ Alpha | Playwright driver, screenshot blocks, click/type, Linux bwrap wrapper when available |
| Security audit CLI | โ Stable | sparrow security audit [--json], WebView /security |
| Sandbox policy | โ Stable | Protected paths, env allowlist; Docker/SSH/Worktree backends; honest vendor errors |
| Media tools | โ Stable | vision, image_generate, text_to_speech, transcribe; WebView upload/artifacts |
| GitHub Action | โ Stable | action.yml, sample workflow, sparrow github review/status/logs, --dry-run |
| Context / compaction | โ Stable | ContextMeter, engine auto-trigger at 120k chars, durable HandoffDoc |
| Gateway | โ Stable | /status roundtrip on port 9338; run registry with real abort |
| Replay / memory | โ Stable | Recorder, checkpoint, rewind, SQLite facts, knowledge graph, optional Neo4j sync, bounded MEMORY.md, session search |
| Provider routing | ๐ถ Alpha | Ollama + NVIDIA tested locally; 92 NVIDIA models discovered |
| First-run setup | ๐ถ Alpha | Conversational setup agent + interactive fallback |
| Telegram / Discord / Slack | ๐ธ Partial | Transport implementations exist; E2E token validation pending |
| Extra transports | ๐งช Experimental | WhatsApp, Signal, Email, Feishu, WeCom, QQ, Teams adapters present |
| Cloud sandboxes | ๐งช Experimental | Modal, Daytona, Vercel, Singularity โ placeholder entries |
| Cross-platform release | โ Stable | Linux ยท macOS ยท Windows pre-built binaries on every tag |
See docs/AUDIT.md for module-by-module proof.
Quick Start
Available today โ same sparrow binary either way:
# Universal (Rust toolchain) โ published on crates.io
# macOS / Linux โ one-liner (pulls the latest GitHub release)
|
# Windows โ PowerShell one-liner
|
Or grab a prebuilt binary directly from the latest release (Linux x86_64, macOS arm64, Windows x86_64).
Package managers (manifests ready, publishing in progress):
# macOS โ Homebrew
# Windows โ Scoop
&&
# Windows 11 โ winget
Then:
That's the 60-second tour. No API key required โ the first-run wizard offers a free provider (Groq / Gemini / NVIDIA) or local Ollama (auto-installed if missing).
Launch Sparrow:
sparrow launch runs first-launch setup when needed, then opens the WebView cockpit on
http://127.0.0.1:9339/. Use sparrow launch --tui for the terminal cockpit.
Build from source:
Run the WebView cockpit:
# โ open http://127.0.0.1:9339/
Routing smoke test:
List detected providers and models:
Force a specific route:
# Local Ollama first
# Explicit NVIDIA route
# Coding / reasoning route
First Configuration
Useful environment variables:
NVIDIA_API_KEY=...
ANTHROPIC_API_KEY=...
OPENAI_API_KEY=...
GROQ_API_KEY=...
OPENROUTER_API_KEY=...
OLLAMA_HOST=http://127.0.0.1:11434
Config lives in the platform config directory (e.g. %APPDATA%\sparrow\config.toml on Windows). Sparrow never needs API keys in the repository.
Provider Routing
Sparrow keeps a static provider registry and expands it with live model discovery when credentials are available. Stored credentials added with sparrow auth add nvidia are used for discovery, so sparrow model --list can populate the NVIDIA catalog even when NVIDIA_API_KEY is not exported.
Default NVIDIA chain:
| Model | Use case |
|---|---|
meta/llama-3.1-8b-instruct |
Fast general chat and cheap smoke tests |
stepfun-ai/step-3.5-flash |
Fast backup route via NVIDIA NIM |
nvidia/nemotron-3-super-120b-a12b |
Stronger fallback for heavier tasks |
sparrow model --set nvidia resets an older pinned config back to this chain.
Common Commands
Custom slash commands can be declared as Markdown files in .sparrow/commands/*.md or %APPDATA%\sparrow\commands\*.md. User-level commands override project and built-in ones by name. Skills are also exposed as slash commands.
Architecture
user task
โ
routing-need classifier
โ
budget-aware fallback chain
โ
Engine
think โ tool โ observe โ emit
โ
โโโโโโโโโโโโผโโโโโโโโโโโโ
CLI TUI WebView
JSON Gateway Recorder
Load-bearing contracts:
| File | Role |
|---|---|
src/event.rs |
Canonical event stream |
src/provider/mod.rs |
Brain abstraction |
src/router/mod.rs |
Model ranking and fallbacks |
src/engine/mod.rs |
Agent loop |
src/tools/mod.rs |
Tool contracts |
src/gateway/mod.rs |
External message routing |
Docs
| Document | Topic |
|---|---|
| docs/AUDIT.md | Module-by-module proof |
| docs/architecture.md | System architecture |
| docs/cli-reference.md | Full CLI reference |
| docs/routing.md | Routing and provider chains |
| docs/autonomy.md | Permission modes and hooks |
| docs/sandboxing.md | Sandbox policy and backends |
| docs/browser-computer.md | Playwright browser and computer-use tools |
| docs/replay.md | Replay and checkpoints |
| docs/swarm.md | Multi-agent swarm |
| docs/keyboard.md | Keyboard shortcuts |
| docs/configuration.md | Configuration reference |
| assets/brand/ | Brand assets (SVG, HTML, ASCII) |
Contributing
Before opening a PR:
Keep docs honest: mark features as Stable, Alpha, Partial, Experimental, or Planned based on tests and runnable examples. See CONTRIBUTING.md.
License
MIT โ see LICENSE.