Skip to main content

🌐 English | 中文

Spark

A local-first AI coding agent with guardrails you can audit.

License: MIT Python 3.11+ Node 18+ CI Security

Approval, three-OS sandboxing, checkpoint rollback and provider resilience are engineered in — not bolted on. One agent loop, seven surfaces. Bring your own OpenAI-compatible endpoint: no account, no telemetry, no vendor lock-in.

# Linux / macOS — SHA256-verified
curl -fsSL https://raw.githubusercontent.com/badhope/spark/main/scripts/install.sh | sh

# Windows (PowerShell)
irm https://raw.githubusercontent.com/badhope/spark/main/scripts/install.ps1 | iex

spark init    # point it at any OpenAI-compatible endpoint
spark web     # open the UI (auto-picks a free port)

No API key? Spark starts in demo mode with a mock model. Paste a key in settings and the next turn uses the real model — no restart.

Chat with reasoning, tool calls and a live context meter


What it does for you

Seven surfaces, one brain Web UI · desktop window · Textual TUI · scriptable CLI · ACP (Zed & co.) · MCP server · A2A server. Same loop, same tools, same permissions everywhere.
Approval you can audit Six approval modes × four sandbox levels. A wildcard rule engine where deny wins across user/project/local scopes. Protected credential paths. Token-level shell checks.
Rollback without fear Every turn snapshots the workspace (tar.gz + manifest verification). Roll back files and conversation — works in non-git directories.
Task-as-branch task_begin → task_step_commit → task_finish. Green tests gate each commit; a red run abandons the branch. A first-class tool, not a demo.
AI reviews AI spark review audits your diff in a forced read-only, sandbox-only turn and returns severity-ranked findings. --json for CI.
Resilient providers A credential pool rotated on failure, a fallback model chain, and a small model for cheap auxiliary calls. One exhausted key never blocks a turn.
Memory with governance AGENTS.md hierarchy (global + project + nested) plus vector long-term memory with dedup merge and capacity eviction, manageable from the UI.

See it

Settings — models. Any OpenAI-compatible endpoint, saved profiles, a real connection probe, three reasoning-effort levels mapped to provider-native params.

Model settings with provider presets and a connection test

Settings — permissions and sandbox. Four access levels with explicit behaviour descriptions. The protected-path list is user-editable; .git/hooks, ~/.spark and Spark's own source always stay protected.

Permission and sandbox settings

Settings — code wiki. Generate a traceable manual from your source tree: one symbol table per module, real line numbers, incremental rebuilds, no network and no model required.

Code wiki panel showing the generated project overview

Scheduled tasks. Cron-triggered prompts that share the same agent. Work missed while the process was down is caught up once on the next start; a busy agent skips rather than queues.

Scheduled automations

Command palette. Ctrl+K fuzzy-jumps to every surface: new session, checkpoints, turn replay, file viewer, web reader, share export, theme, language.

Command palette

Quick start

spark                         # TUI
spark web                     # browser UI on 127.0.0.1 (auto-picks a port)
spark desktop                 # native window, loopback only
spark exec "task" --json      # NDJSON event stream for scripts and CI
spark review                  # audit the uncommitted diff
spark wiki --refresh          # regenerate the local code wiki
spark doctor                  # diagnose config, credentials, runtime
spark uninstall --list        # show exactly what would be removed

spark exec streams one JSON object per line and ends with {"type":"final","text":"…"}, so it pipes into jq without post-processing.

Seven surfaces

Form Command Use case
Web UI spark web Everyday chat, file viewer, terminal, execution graph
Desktop spark desktop Native pywebview window, loopback-only
TUI spark Pure terminal / SSH
CLI spark exec "task" --json Automation, CI, piping
IDE (ACP) spark acp Zed and other ACP clients — docs/ACP.md
MCP server spark mcp-serve Expose every built-in tool to other MCP clients
A2A server spark a2a-serve Agent-to-agent delegation — docs/A2A.md

How the guardrails fit together

Three layers, each narrowing the previous one:

  1. Approval — six modes from plan-only (plan, change nothing) to full-auto. The default suggest asks before any write or command.
  2. Sandbox — sandbox-only / workspace (default) / full-access / unrestricted. Path escapes and protected paths are refused outright.
  3. Rules — [[permission_rules]] match tool + resource across three scopes. deny wins across scopes, so a cloned repository can tighten permissions but never grant itself more.

OS-level isolation is layered on top: bwrap on Linux, a Job Object on Windows (process-tree kill-on-close plus a memory ceiling), sandbox-exec on macOS. Where a platform cannot enforce something, the tool result says so instead of pretending.

Verified locally, not just in CI

pytest -q                                  # ~1400 tests
ruff check src tests scripts
mypy src/spark --ignore-missing-imports
bandit -r src/spark -ll -ii -c bandit.yaml
lint-imports                               # 5 architecture contracts

CI additionally runs secret scanning (gitleaks + trufflehog), an OpenAPI snapshot freshness check, a coverage floor, a Windows-reserved-path check, packaging checks, and a mock-mode agent eval suite on Linux and Windows.

Documentation

Document Contents
docs/INSTALL.md Install, package, desktop build, auto-update, uninstall
docs/CONFIG.md Every config key and environment variable
docs/API.md HTTP API and SSE event protocol
docs/ARCHITECTURE.md Layering and module boundaries
docs/FEATURES.md Feature-by-feature implementation map
docs/A2A.md A2A agent card, streaming, task lifecycle
docs/competitive-comparison.md How it compares to Qoder / ZCode / opencode / Codex CLI
docs/reviews/ Audit reports with findings, fixes and honest limits
vscode-spark/ VS Code extension

Platform requirements

  • Python 3.11+ — or the bundled executable, no Python needed
  • Node.js 18+ for frontend development only (release builds ship compiled assets)
  • Windows / macOS / Linux

License: MIT · Author: badhope

Metadata

Release files for spark-agent 0.13.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spark-agent 0.13.1
File Size Uploaded Provenance Actions
spark_agent-0.13.1.tar.gz 1.0 MB Without provenance Details for spark_agent-0.13.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for spark-agent 0.13.1
File Interpreter ABI Platform Actions
spark_agent-0.13.1-py3-none-any.whl Python 3 none any Details for spark_agent-0.13.1-py3-none-any.whl

Total release size: 1.9 MB

Release files / spark_agent-0.13.1.tar.gz

Download URL spark_agent-0.13.1.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
99dccfdf0dba0de8a2bb98c884451fadb45be675769f57103e4da8546e132155
BLAKE2b-256 checksum
How to use checksums
7862d72bfdc8ca59bc2dd5be1f6df4e7a14edd595bb3e943608a172232a74904
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / spark_agent-0.13.1-py3-none-any.whl

Download URL spark_agent-0.13.1-py3-none-any.whl
Size 890.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88c499f4115dd0325578c9d862a36d1198109dc9157ce1b531515fa1c5105e15
BLAKE2b-256 checksum
How to use checksums
54f4feed276482492cd59fbdb8516f2331cf209c174a54b2d77a195ddfcde02c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for spark-agent 0.13.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page