Shell integration
The spai Command
Section titled “The spai Command”spai is the primary interface to spaiSH. It works from any shell — bash, zsh, fish, or any POSIX-compatible shell.
Your existing shell and workflow are completely unchanged. spai is an additional command, not a replacement. Regular shell commands never pass through AI.
$ ls -la # normal shell, no AI involved$ git status # same$ spai explain why my build failed # only this goes through spaidspai <natural language query>Examples
Section titled “Examples”# System administrationspai nginx keeps returning 502, find out whyspai show me what's using the most disk spacespai which process is listening on port 3000
# File operationsspai find all log files modified in the last 24 hoursspai compress everything in ~/Downloads older than 30 days
# Developmentspai why did my last git push failspai explain what this Makefile doesspai set up a python virtual environment for this project
# Diagnosticsspai my wifi keeps dropping, check what's wrongspai why is this machine running slow right nowspai --dry-run "clean up old docker images" # show plan, never executespai --local "explain this log file" # force local modelspai --legal # print disclaimer and exitspai --help # usage informationspai !! # analyse the last failed commandHow It Works
Section titled “How It Works”- You run
spai <query> spaiconnects to thespaiddaemon via Unix socketspaidadds system context (current directory, recent history, git state)spaidroutes the request to your configured AI provider- The AI proposes a plan — one or more commands
spaidclassifies each command by permission tier- Commands that require confirmation are shown to you before running
- You confirm, and the commands execute
- Output streams back to your terminal
- You’re back at your normal prompt
First Run
Section titled “First Run”On first run, spaiSH shows a one-time disclaimer:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ spaiSH — experimental personal project Not affiliated with any AI provider or Linux distribution. You are responsible for your API key usage and costs. Run 'spai --legal' for full disclaimer and license.━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━This is shown once and never again.
Installation
Section titled “Installation”Requirements
Section titled “Requirements”- Linux (any modern distribution)
- systemd (for the user service)
- An AI provider API key or Ollama running locally
Install
Section titled “Install”curl -fsSL https://get.spaish.dev/install.sh | bashNo root required. The installer:
- Downloads
spaiandspaidbinaries to~/.local/bin/ - Creates default config at
~/.config/spaish/spaid.toml - Registers
spaidas a systemd user service - Prints next steps
Configure your AI provider
Section titled “Configure your AI provider”Set your API key as an environment variable. Add to ~/.bashrc or ~/.zshrc:
export SPAI_API_KEY="your-key-here"Then edit ~/.config/spaish/spaid.toml to point at your provider’s endpoint and set your model name.
Using a local model instead
Section titled “Using a local model instead”Install Ollama and pull a model:
# Install Ollama (see ollama.com for instructions)ollama pull qwen2.5-coder # recommended for system tasksspaiSH will automatically use Ollama if no API key is set and Ollama is running.
Uninstall
Section titled “Uninstall”curl -fsSL https://get.spaish.dev/uninstall.sh | bashRemoves all binaries, config, and the systemd service. Your shell rc file is cleaned up.
Managing the Daemon
Section titled “Managing the Daemon”systemctl --user status spaid # check if runningsystemctl --user restart spaid # restartsystemctl --user stop spaid # stopjournalctl --user -u spaid -f # live logs