sprout

command module
v0.21.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

README

Sprout

AI-powered coding agent and development environment: a chat-first CLI, a Web UI, and nine specialized personas that collaborate to understand your workspace, edit code, run tests, open PRs, and drive multi-step tasks against any LLM provider.

Cost & safety: Sprout talks to LLM providers and external services, which may incur per-token costs. It ships a 5-profile risk cascade (readonly … unrestricted), per-hunk diff approval, and configurable tool allowlists — start with cautious or readonly. See docs/SECURITY.md.

Install

Linux / macOS:

curl -fsSL https://raw.githubusercontent.com/sprout-foundry/sprout/main/scripts/install.sh | sh

Windows (PowerShell 5.1+):

irm https://raw.githubusercontent.com/sprout-foundry/sprout/main/scripts/install.ps1 | iex

The installer verifies each release's SHA-256 checksum, supports Termux on Android, and installs to SPROUT_INSTALL_DIR when set — see scripts/install.sh. Run it again to upgrade.

Getting started

sprout                                                          # interactive mode (prints the Web UI URL)
sprout agent "Create a python script that prints 'Hello, World!'"
sprout agent --persona coder "Add JWT auth to the API"
sprout plan                                                     # planning mode (proposes a plan; builds after you approve)
sprout review                                                   # AI review of staged changes
sprout commit                                                   # generate a conventional commit
sprout pr                                                       # open a PR for the current branch
sprout search "rate limit"                                      # search past sessions

First run walks you through provider selection and API-key validation: docs/onboarding.md.

What's included
  • Agent + 9 personas (orchestrator, coder, tester, reviewer, …) with parallel subagents, mid-flight steering, and cooperative cancellation; 40+ slash commands for in-session control
  • Web UI — chat, editor, file tree, terminal, git UI, settings, session cost meter; built into the binary, nothing extra to install
  • Providers — OpenAI, DeepInfra, OpenRouter, Z.AI, GLM Coding Plan, DeepSeek, Mistral, MiniMax, LMStudio, Cerebras, Chutes, Ollama Cloud, plus self-hosted Ollama and any OpenAI-compatible endpoint (sprout custom add); the embedded catalog refreshes between releases
  • Safety — risk cascade, per-hunk diff approval, security audit log (sprout audit)
  • Skills & MCP — loadable instruction packs (sprout skill) and external tool servers (sprout mcp)
  • LSP — diagnostics, definitions, rename via sprout lsp
  • Automations — JSON-defined workflows under automate/, run with sprout automate
  • History — every file mutation tracked and reversible (sprout log / sprout history); full-text search across past sessions (sprout search)
  • Service mode — background daemon with HTTP API and WebSocket terminal/editor sessions (sprout service)

Configuration

Configuration is layered — global defaults, optional per-workspace overrides, then session settings — with later layers winning. Every field is also editable in the Web UI settings panel. References: docs/CONFIGURATION.md and docs/FALLBACKS.md (every default and inheritance chain).

Risk profiles control what runs without prompting:

Profile Behavior
readonly Read-only operations only; mutations blocked
cautious Most operations prompt; subagent writes blocked
default Auto-approves reads and common edits; destructive ops prompt
permissive High trust; almost everything runs without prompting
unrestricted No gating; only critical patterns (rm -rf /, fork bombs) block
sprout agent --risk-profile=cautious "review this PR"           # per session
# persistent: set "risk_profile" in your sprout config (see CONFIGURATION.md)

Full model: docs/SECURITY.md.

Development

Requirements: Go 1.26+ and Node.js 22+.

git clone https://github.com/sprout-foundry/sprout.git
cd sprout
make prepare-grammars        # editor language grammars (needed for IDE; Make targets run it automatically)
make build-all               # WASM shell + embedded Web UI + Go binary
./sprout                     # run from the repo root

On Windows without make/bash, powershell -File scripts\prepare-grammars.ps1 then go build . builds the binary; the agent's shell tool uses Git for Windows' bash when installed (cmd.exe otherwise).

Command What it does
make build-all Build everything (WASM, Web UI, binary)
make test-smoke Fast smoke suite
go test ./... Go unit tests
make test-webui-vitest Web UI unit tests (vitest)
npx playwright test --project=webui test/webui/<spec>.spec.ts Web UI e2e (backend + Vite stack auto-starts)
make vet && make fmt-check && make lint Pre-PR gates

Web UI development with hot reload: run the backend (./sprout agent --daemon) next to the Vite dev server (cd webui && npm run dev) and edit webui/src/** with instant HMR at http://localhost:3000 — no UI rebuild needed. ./sprout serve swaps in a canned-response mock LLM so no provider credentials are required. Full instructions and gotchas: webui/DEVELOPMENT.md.

Agent guidance for working in this repo: AGENTS.md. Contribution rules: CONTRIBUTING.md. Authoritative specs: roadmap/ (SP-###.md).

Architecture in 30 seconds

  • CLI (sprout, Go) — cobra command tree, 30+ commands (agent, plan, commit, review, pr, search, service, …)
  • Web UI (webui/, React 18 + Vite + TypeScript) — built by make deploy-ui, embedded in the binary
  • @sprout/ui (packages/ui) — shared component library, npm install @sprout/ui consumes it standalone; @sprout/events ships the event schemas
  • Provider catalog (pkg/providercatalog/providers.json) — embedded in the binary, refreshed from GitHub at startup
  • Sister project sprout-foundry pins a SPROUT_VERSION and ships the binary in Docker images — integration contract: docs/FOUNDRY_CHAT_CONTRACT.md

Full layout and data flow: docs/ARCHITECTURE.md. Platform matrix (Linux/macOS/Windows/WASM/no-CGO): docs/PLATFORM_SUPPORT.md.

Documentation

Document Description
CLI Reference All commands, flags, slash commands, personas, tools
Onboarding Guided first-run setup (provider → API key → first chat)
Configuration Config files, environment variables, Zsh detection, CI/CD
Fallbacks Every default, inheritance, and fallback resolution chain
Architecture Package layout, data flow, workspace files
Security Risk profiles, tool call classification, security model
Personas Persona system, risk model, custom personas
MCP Integration MCP server setup, configuration, troubleshooting
Agent Workflow Config-driven workflow sequences
Service / Daemon Run sprout as a long-lived HTTP/WS service
Local LLM (MLX) Local models via MLX — no API key or network
Provider Catalog Provider catalog system and model metadata
Provider Registry Remote provider registry, community provider PRs
LSP Architecture Language server integration
Component Library @sprout/ui usage and architecture
Electron Launcher Desktop app wrapper
Testing Test strategy, categories, commands
Changelog Per-release commit log
Roadmap Authoritative spec docs (SP-###.md) for planned and shipped work

License & support

Apache 2.0 — see LICENSE. Report issues at github.com/sprout-foundry/sprout/issues.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
Agent command for sprout
Agent command for sprout
audit_pricing command
enrich_registry command
Command enrich_registry annotates freshly-generated canonical model files with capability-probe results.
Command enrich_registry annotates freshly-generated canonical model files with capability-probe results.
generate_studio_providers command
Command generate_studio_providers derives the STUDIO_PROVIDERS snapshot embedded in the studio bridge (sprout-studio/shared/studio-bridge.js) from the provider registry, eliminating the hand-maintained copy that had drifted from the real provider configs.
Command generate_studio_providers derives the STUDIO_PROVIDERS snapshot embedded in the studio bridge (sprout-studio/shared/studio-bridge.js) from the provider registry, eliminating the hand-maintained copy that had drifted from the real provider configs.
model_probe command
Command model_probe runs the capability probe against a single provider/model and prints the result as JSON.
Command model_probe runs the capability probe against a single provider/model and prints the result as JSON.
model_registry_server command
Command model_registry_server runs a lightweight static file server for serving per-provider model JSON files.
Command model_registry_server runs a lightweight static file server for serving per-provider model JSON files.
sync_provider_configs command
Command sync_provider_configs updates the embedded provider config models.available_models field to match the canonical registry.
Command sync_provider_configs updates the embedded provider config models.available_models field to match the canonical registry.
validate_registry command
Command validate_registry checks every providers/*.json against the runtime schema before the publish workflow uploads to GitHub Pages.
Command validate_registry checks every providers/*.json against the runtime schema before the publish workflow uploads to GitHub Pages.
wasm command
internal
testgit
Package testgit redirects git's config lookup inside test binaries so a subprocess git call can never read or write the developer's real ~/.gitconfig or /etc/gitconfig.
Package testgit redirects git's config lookup inside test binaries so a subprocess git call can never read or write the developer's real ~/.gitconfig or /etc/gitconfig.
pkg
agent
Package agent: delegation getters and setters for sub-managers.
Package agent: delegation getters and setters for sub-managers.
agent/approvals
Package approvals: the ApprovalAgent seam (SP-141 phase 3, increment 5).
Package approvals: the ApprovalAgent seam (SP-141 phase 3, increment 5).
agent/changes
Auto-skip learning for ChangeTracker shell-mutation tracking.
Auto-skip learning for ChangeTracker shell-mutation tracking.
agent/subagents
Package subagents: the process-wide active-subagent counter and the terminal display-prefix builder (SP-141 phase 4, increment 1).
Package subagents: the process-wide active-subagent counter and the terminal display-prefix builder (SP-141 phase 4, increment 1).
agent/workflow
Package workflow provides the in-process workflow runner for TODO-loop workflows.
Package workflow provides the in-process workflow runner for TODO-loop workflows.
agent_api
Package agent_api: LM Studio model-list discovery.
Package agent_api: LM Studio model-list discovery.
agent_providers
provider_config_timeouts.go — timeout + limit accessor methods on ProviderConfig, split from provider_config.go.
provider_config_timeouts.go — timeout + limit accessor methods on ProviderConfig, split from provider_config.go.
agent_tools
design_export_paths.go — output-path confinement + artifact-relocation helpers for the design_export_tokens handler, split from design_export_handler.go.
design_export_paths.go — output-path confinement + artifact-relocation helpers for the design_export_tokens handler, split from design_export_handler.go.
agent_tools/computer_use
Package computer_use denylist loader.
Package computer_use denylist loader.
ast
Package ast (continued) — body extraction.
Package ast (continued) — body extraction.
automate
Package automate provides shared workflow discovery and validation for the automate/ feature used by both the CLI (cmd/automate.go) and the agent tool layer (pkg/agent/tool_handlers_automate.go).
Package automate provides shared workflow discovery and validation for the automate/ feature used by both the CLI (cmd/automate.go) and the agent tool layer (pkg/agent/tool_handlers_automate.go).
buildinfo
Package buildinfo holds build-time metadata shared by the CLI, the WebUI bootstrap payload, and the update checker.
Package buildinfo holds build-time metadata shared by the CLI, the WebUI bootstrap payload, and the update checker.
clihooks
Package clihooks holds tiny callback hooks that wire higher-level CLI behavior (e.g.
Package clihooks holds tiny callback hooks that wire higher-level CLI behavior (e.g.
cliui
Package cliui hosts the CLI terminal display helpers extracted from cmd/.
Package cliui hosts the CLI terminal display helpers extracted from cmd/.
configuration
Package configuration: command categorization and force-flag detection.
Package configuration: command categorization and force-flag detection.
console
Reasoning (collapsed "Thinking" header) methods for AssistantTurnRenderer, split from assistant_turn_renderer.go.
Reasoning (collapsed "Thinking" header) methods for AssistantTurnRenderer, split from assistant_turn_renderer.go.
credentials
Encryption and decryption operations
Encryption and decryption operations
daemon
Package daemon — Phase 2: Daemon lifecycle + auto-start machinery.
Package daemon — Phase 2: Daemon lifecycle + auto-start machinery.
design
Package design defines the design workspace directory contract: the design/ tree layout, the manifest scaffold, and parsers for the machine-readable manifest blocks.
Package design defines the design workspace directory contract: the design/ tree layout, the manifest scaffold, and parsers for the machine-readable manifest blocks.
envutil
Package envutil provides environment variable helpers with SPROUT_* prefix support.
Package envutil provides environment variable helpers with SPROUT_* prefix support.
errors
Package errors provides agent-specific error types and classification for intelligent retry/recovery logic.
Package errors provides agent-specific error types and classification for intelligent retry/recovery logic.
events
Event bus implementation
Event bus implementation
git
ETH-1 "sync-on-resume": reconcile the git state of a workspace container and report it as a single JSON object.
ETH-1 "sync-on-resume": reconcile the git state of a workspace container and report it as a single JSON object.
history
Audit logging for SP-077: tracks every write-back of OriginalCode (or NewCode) to the working tree.
Audit logging for SP-077: tracks every write-back of OriginalCode (or NewCode) to the working tree.
llmproxy
Package llmproxy provides an http.RoundTripper that rewrites direct calls to well-known LLM provider endpoints (api.openai.com, api.anthropic.com, etc.) so they instead route through the sprout-foundry platform's /api/proxy/llm/{provider}/* path.
Package llmproxy provides an http.RoundTripper that rewrites direct calls to well-known LLM provider endpoints (api.openai.com, api.anthropic.com, etc.) so they instead route through the sprout-foundry platform's /api/proxy/llm/{provider}/* path.
localmodel
Model download + on-disk config helpers (split from model.go).
Model download + on-disk config helpers (split from model.go).
lsp/proxy
Package proxy provides an LSP (Language Server Protocol) proxy manager that manages language server processes for workspace-aware code intelligence.
Package proxy provides an LSP (Language Server Protocol) proxy manager that manages language server processes for workspace-aware code intelligence.
mcp
modelcontract
Package modelcontract defines the canonical, provider-agnostic model schema and the adapter interface that normalizes each provider's native model API into it.
Package modelcontract defines the canonical, provider-agnostic model schema and the adapter interface that normalizes each provider's native model API into it.
modelprobe
Package modelprobe runs a bounded capability probe against a model to check, cheaply and objectively, whether it's usable for agentic coding — and whether it's strong enough for complex work.
Package modelprobe runs a bounded capability probe against a model to check, cheaply and objectively, whether it's usable for agentic coding — and whether it's strong enough for complex work.
modelregistry
Package modelregistry provides a client for fetching per-provider model lists from a static JSON model registry server with in-memory caching.
Package modelregistry provides a client for fetching per-provider model lists from a static JSON model registry server with in-memory caching.
noninteractive
Package noninteractive provides utilities for detecting and handling provider-not-configured errors in non-interactive environments (daemons, CI, piped stdin).
Package noninteractive provides utilities for detecting and handling provider-not-configured errors in non-interactive environments (daemons, CI, piped stdin).
notify
Package notify provides cross-platform OS-level desktop notifications.
Package notify provides cross-platform OS-level desktop notifications.
providercatalog
Package providercatalog is the curated UX layer for provider onboarding — friendly descriptions, signup URLs, API-key help text, recommended-model justifications.
Package providercatalog is the curated UX layer for provider onboarding — friendly descriptions, signup URLs, API-key help text, recommended-model justifications.
providerregistry
Remote provider cache and configuration.
Remote provider cache and configuration.
redact
Package redact provides byte-oriented secret redaction for log files and other persisted artifacts.
Package redact provides byte-oriented secret redaction for log files and other persisted artifacts.
search
Package search provides cross-session search indexing capabilities.
Package search provides cross-session search indexing capabilities.
secretdetect
Package secretdetect provides secret detection backed by the gitleaks detection engine.
Package secretdetect provides secret detection backed by the gitleaks detection engine.
shelltext
Package shelltext provides shared helpers for scanning shell command text: quote stripping, heredoc stripping, and git history-rewrite detection.
Package shelltext provides shared helpers for scanning shell command text: quote stripping, heredoc stripping, and git history-rewrite detection.
skills
Package skills owns the catalogue of skills shipped with sprout.
Package skills owns the catalogue of skills shipped with sprout.
testutil
Package testutil provides shared helpers for sprout's test suite.
Package testutil provides shared helpers for sprout's test suite.
training
Package training provides utilities for exporting session data into training-ready formats (ShareGPT, OpenAI fine-tuning JSONL, Alpaca).
Package training provides utilities for exporting session data into training-ready formats (ShareGPT, OpenAI fine-tuning JSONL, Alpaca).
txn
ETH-2 "transactional escalation": the container-side execution surface of a three-phase transaction the platform drives against a workspace container — push deltas (browser→container), run a command, pull deltas (container→browser).
ETH-2 "transactional escalation": the container-side execution surface of a three-phase transaction the platform drives against a workspace container — push deltas (browser→container), run a command, pull deltas (container→browser).
ui
updatecheck
Package updatecheck implements the passive "new release available" check: it throttles GitHub release lookups to once per check interval, caches the result in the sprout state directory, and answers "is there a newer version than X" for the CLI notice and the WebUI banner.
Package updatecheck implements the passive "new release available" check: it throttles GitHub release lookups to once per check interval, caches the result in the sprout state directory, and answers "is there a newer version than X" for the CLI notice and the WebUI banner.
utils
Package utils provides error handling utilities and conventions for the codebase.
Package utils provides error handling utilities and conventions for the codebase.
utils/console
Package console provides Windows console utilities shared between pkg/automate (StopProcess escalation) and pkg/agent_tools (interruptProcessGroup).
Package console provides Windows console utilities shared between pkg/automate (StopProcess escalation) and pkg/agent_tools (interruptProcessGroup).
utils/pidalive
Package pidalive provides a single canonical answer to "is this PID alive?" for all of sprout.
Package pidalive provides a single canonical answer to "is this PID alive?" for all of sprout.
utils/shellexec
Package shellexec builds the *exec.Cmd that runs a command line through the user's shell.
Package shellexec builds the *exec.Cmd that runs a command line through the user's shell.
validation
Package validation provides syntax validation using gofmt/goimports
Package validation provides syntax validation using gofmt/goimports
webcontent
browser_rod_discovery.go — GPU probe + system browser discovery, split from browser_rod_launch.go.
browser_rod_discovery.go — GPU probe + system browser discovery, split from browser_rod_launch.go.
webui
Design status endpoint — SP-140-6 §6b.
Design status endpoint — SP-140-6 §6b.
zsh
gomlx module
tensor module
test
webui/fixtures/designtokencss command
Command designtokencss regenerates design/generated/tokens.css for a workspace root — exactly the design_export_tokens css target (design.ResolveExportTokens + RenderArtifacts + WriteExportedArtifactsAt).
Command designtokencss regenerates design/generated/tokens.css for a workspace root — exactly the design_export_tokens css target (design.ResolveExportTokens + RenderArtifacts + WriteExportedArtifactsAt).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL