Experimental · open source · Apache-2.0

Your terminal,
in plain language.

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.

zsh — spai
$ 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 30sproxy_read_timeout 90s
  Allow? [y/N]: 

Why spai

An agent that respects your machine

Everything Claude Code does for your codebase — brought to the whole shell, on your terms.

🗣️

Plain language

Describe the goal. spai plans, reads files, runs commands, and edits code to get there.

🔒

Permission-gated

A tiered gate sits in front of anything that changes your system. Commands are parsed, not string-matched.

🔌

Any model

Anthropic Claude, any OpenAI-compatible endpoint, or fully local via Ollama. Switch mid-session.

📦

One binary

A single small Go binary. No daemon, no socket, no background service, no database.

How it works

A native tool-calling loop, fully gated

The model streams text and tool calls; each call is classified for risk, gated, executed, and fed back — until the task is done.

Permission gate

command-parsed
  • read read_file · glob · grep — runs freely
  • write write_file · edit_file — confirmed in manual mode
  • elevated sudo & destructive — always asks, session-scoped

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.

Built-in tools

7native tools
bashread_filewrite_fileedit_fileglobgreplist_dir

Execution modes

manualasks before changes
autoruns everything
planproposes, never runs

Shift-Tab cycles the mode mid-session; /mode sets it explicitly.

Session & routing

RemoteClaude / OpenAI
LocalOllama
Contextauto-compact

Sessions are file-backed and compact themselves as they grow. /cost shows token usage; spai resume reopens the last one.

Bring your own model

Remote or fully local

🧠

Anthropic

Native Claude support — the default. Point at a model and export your key as an env var.

🔗

OpenAI-compatible

Any endpoint that speaks the OpenAI API — hosted or self-run. Just set the base URL.

🖥️

Ollama (local)

Full privacy mode. Pull and switch local models from the terminal; never leave the machine.

Explore

Everything spai does

Quickstart

Up in under a minute

# 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?"