zerostack logo zerostack
Rust · Terminal · Open Source

zerostack

Minimal AI coding agent for the terminal, written in Rust. Sandboxed execution, granular permissions, MCP support, session rewind; ready for your workflow

$cargo install zerostack
~30k
Lines of Code
26MB
Binary Size
~16 MB
RAM (avg)
0.0%
CPU (idle)
Section 1

1.Overview

zerostack TUI screenshot
Figure 1 — The zerostack terminal interface.
Section 2

2.Prompts

Built-in system prompts that change the agent's behavior and tone — switch at runtime with /prompt:

PromptDescription
codeCoding mode with full file & bash access, TDD workflow
planPlanning-only — explores and produces a plan without code
reviewCode review for correctness, design, testing, and impact
debugFinds root cause before proposing fixes
askRead-only mode — no writes or bash
brainstormDesign-only — explores ideas without code
frontend-designDistinctive, production-grade UI
review-securityFinds exploitable vulnerabilities
simplifyRefines for clarity without behavior change
write-promptCreates and optimizes agent prompts

Custom prompts can be created by placing markdown files in $XDG_CONFIG_HOME/zerostack/prompts/.

Section 3

3.Permissions

ModeCLIBehavior
restrictive-RAsk for every operation
readonly--read-onlyRead/grep/list only. Deny writes, edits, bash
guarded--guardedAllow reads. Ask for writes, edits, bash
standard(default)Allow path tools within CWD. Safe bash auto-allowed
yolo--yoloAllow everything, prompt for destructive commands

Per-tool granular glob patterns, session allowlists, and doom-loop detection prevent runaway agents. The --dangerously-skip-permissions flag bypasses all checks.

Section 4

4.Commands

/model — Switch model
/thinking — Set thinking level
/clear — Clear conversation
/session — List/save/load sessions
/loop — Schedule recurring prompts
/prompt — List or change system prompt
/mode — Set permission mode
/worktree — Create git worktree and move into it
/wt-merge — Merge worktree branch, clean up, return (no push)
/wt-exit — Return to main repo without merging
/queue — Manage input queued while the agent is busy
/btw — Ask a quick side question in parallel
/review — Run a one-shot code review
/hooks (gated) — Show the installed hook dispatcher config
/advisor (gated) — Show or change advisor status
/help — Show all commands
Section 5

5.Documentation

Section 6

6.Quick Start

# Set your API key (OpenRouter is default)
export OPENROUTER_API_KEY="[api_key]"

# Interactive session (default prompt: code)
zerostack

# Monochrome TUI
zerostack --no-color

# One-shot mode
zerostack -p "Explain this project"

# Continue last session
zerostack -c

# Explicit provider/model
zerostack --provider openrouter --model deepseek/deepseek-v4-flash
Section 7

7.License

GPL-3.0-only