spai is a Claude-Code-style AI agent for your shell. Ask for what you want — it reads files, runs commands, and edits code on your behalf, with a permission gate in front of anything that changes your system.
$ spai "nginx keeps returning 502, find and fix it" ▶ read_file /var/log/nginx/error.log ▶ read_file /etc/nginx/nginx.conf Found an upstream timeout: proxy_read_timeout is 30s but the backend needs ~90s. ▶ [Write] edit /etc/nginx/nginx.conf proxy_read_timeout 30s → proxy_read_timeout 90s Allow? [y/N]:
Why spai
Everything Claude Code does for your codebase — brought to the whole shell, on your terms.
Describe the goal. spai plans, reads files, runs commands, and edits code to get there.
A tiered gate sits in front of anything that changes your system. Commands are parsed, not string-matched.
Anthropic Claude, any OpenAI-compatible endpoint, or fully local via Ollama. Switch mid-session.
A single small Go binary. No daemon, no socket, no background service, no database.
How it works
The model streams text and tool calls; each call is classified for risk, gated, executed, and fed back — until the task is done.
Safety is decided by parsing each
shell command — so rm -rf, rm --recursive, and
a && rm -rf b are all caught, while echo "rm -rf" is not.
Shift-Tab cycles the mode
mid-session; /mode sets it explicitly.
Sessions are file-backed and compact
themselves as they grow. /cost shows token usage; spai resume
reopens the last one.
Bring your own model
Native Claude support — the default. Point at a model and export your key as an env var.
Any endpoint that speaks the OpenAI API — hosted or self-run. Just set the base URL.
Full privacy mode. Pull and switch local models from the terminal; never leave the machine.
Quickstart
# clone & install (downloads a prebuilt binary, or builds from source) git clone https://github.com/srjn45/spaiSH && cd spaiSH ./install.sh # pick a provider, set the model, run a live connection test spai init # ask for anything spai "summarise what changed in the last 5 commits" spai # interactive multi-turn session git log | spai "anything worrying here?"