🌐 English | 中文
Spark
Local-first AI coding agent and office workbench — with guardrails you can audit.
One agent loop, eight surfaces, one permission model. Spark runs coding tasks, office workflows and an enterprise control plane on the same auditable core: approval before writes, sandboxed execution, checkpoint rollback, and a provider layer that works with any OpenAI-compatible endpoint.
# 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 # browser UI (auto-picks a free port)
No API key? Spark starts in demo mode with a scripted mock model. Add a key in settings and the next turn uses the real model — no restart.
Why Spark
- Auditable execution. Six approval modes × four sandbox levels. Wildcard
rules across user/project/local scopes, where
denyalways wins. Protected credential paths and token-level shell checks. - Recoverable by design. Every turn snapshots the workspace (tar.gz + manifest verification). Roll back files and conversation together — also 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. - Enterprise control plane.
/api/v1with tenants, projects, tasks, artifacts and audit. SQLite for local development; PostgreSQL, Keycloak OIDC and Casbin for production. - Office workbench with real files.
/officeturns meeting transcripts and documents into cited minutes, action items, reports and spreadsheets, then exports Markdown, Word, Excel, PowerPoint and PDF. Import docx/xlsx/pptx/pdf, email, images and scanned PDFs (local OCR); transcribe meeting recordings on the machine (Whisper — the audio never leaves it); optional AI summaries when a model is configured.SPARK_CONTROL_BRAND_*puts your own name, colour and logo on the output without touching the content or the citations. - Provider freedom. Any OpenAI-compatible endpoint, fallback model chain, credential pool and a separate small model for auxiliary calls.
Quick start
spark # terminal TUI
spark web # browser UI on 127.0.0.1
spark desktop # native window, loopback only
spark enterprise # enterprise /api/v1 control plane
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 and runtime
The office workbench is served by the enterprise control plane:
spark enterprise --host 127.0.0.1 --port 18800
# http://127.0.0.1:18800/office
spark exec streams one JSON object per line and ends with
{"type":"final","text":"…"}, so it pipes straight into jq.
Eight surfaces
| Form | Command | Use case |
|---|---|---|
| Web UI | spark web |
Chat, file viewer, terminal, execution graph |
| Enterprise API | spark enterprise |
/api/v1 control plane and /office |
| 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 built-in tools to other MCP clients |
| A2A server | spark a2a-serve |
Agent-to-agent delegation — docs/A2A.md |
Guardrails
Three layers, each narrowing the previous one:
- Approval — from
plan-only(plan, change nothing) tofull-auto. The defaultsuggestasks before any write or command. - Sandbox —
sandbox-only/workspace(default) /full-access/unrestricted. Path escapes and protected paths are refused outright. - Rules —
[[permission_rules]]match tool + resource across three scopes. A cloned repository can tighten permissions, 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
pytest -q # 1493 passed, 3 skipped
ruff check src tests scripts
mypy src/spark --ignore-missing-imports
bandit -r src/spark -ll -ii -c bandit.yaml
lint-imports # architecture contracts
CI additionally runs secret scanning, 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/ENTERPRISE.md | /api/v1, /office, PostgreSQL, Keycloak, Casbin, Alembic |
| 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.15.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| spark_agent-0.15.0.tar.gz | 1.1 MB | Without provenance | Details for spark_agent-0.15.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| spark_agent-0.15.0-py3-none-any.whl | Python 3 | none | any | Details for spark_agent-0.15.0-py3-none-any.whl |
Total release size: 2.1 MB
Release files / spark_agent-0.15.0.tar.gz
| Download URL | spark_agent-0.15.0.tar.gz |
|---|---|
| Size | 1.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f03eb5e96f8f03618ec4e81c39e9076ff7570d9ea87f828e29fd18e9c0cec9d5
|
|
BLAKE2b-256 checksum How to use checksums |
fb6fde157b057efe31845c3a5fd7dcdbbf3b2c650b1dbcb5767b4888f279b7fa
|
| 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.15.0-py3-none-any.whl
| Download URL | spark_agent-0.15.0-py3-none-any.whl |
|---|---|
| Size | 962.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6524852024c397c5f507393baf2169a5e5ed60f78511895c7e140eceb966ea3d
|
|
BLAKE2b-256 checksum How to use checksums |
8e439651bf93598e811360634d23f4af7e6a42c1482a84793867ab49aa9e1f28
|
| 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.15.0
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.