Skip to main content

🌐 English | 中文

Spark

Local-first AI coding agent and office workbench — with guardrails you can audit.

License: MIT Python 3.11+ Node 18+ CI Security

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.

Spark chat with reasoning, tool calls and a live context meter

Why Spark

  • Auditable execution. Six approval modes × four sandbox levels. Wildcard rules across user/project/local scopes, where deny always 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/v1 with tenants, projects, tasks, artifacts and audit. SQLite for local development; PostgreSQL, Keycloak OIDC and Casbin for production.
  • Office workbench with real files. /office turns 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:

  1. Approval — 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. 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.2

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.15.2
File Size Uploaded Provenance Actions
spark_agent-0.15.2.tar.gz 1.1 MB Without provenance Details for spark_agent-0.15.2.tar.gz

Built distribution (wheel)

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

Total release size: 2.1 MB

Release files / spark_agent-0.15.2.tar.gz

Download URL spark_agent-0.15.2.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
9ac75e7fd19035de35bdba9f1d5f222ce9b175b2ec619e04435ab3b7c41f92d7
BLAKE2b-256 checksum
How to use checksums
3fef638968668715ea138e7acbc834f9a7395f9346d55f0b9dde2afaef448988
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.2-py3-none-any.whl

Download URL spark_agent-0.15.2-py3-none-any.whl
Size 962.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f2ad36164551296cccbcb73c5cbf83c5c695be66b87f148cbfba987df5ef0b7
BLAKE2b-256 checksum
How to use checksums
c1b14af39364de36f5d2a8e7529f91d7bb1fa58f8ab0da5a704bf1227a615424
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.2

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