Warp-style inline AI command suggestions for Zsh in ~300 lines of shell.
After every command, aish looks at what you ran, whether it failed, what it printed, and your project context (git status, files, history), then predicts the most likely next command as grey inline text. Tab accepts it. Pause mid-command and it completes what you started.
One file, ~300 lines of zsh. Dependencies: zsh 5.3+ and curl. Works in any terminal. Nothing is ever executed on your behalf.
Install
curl -fsSL https://raw.githubusercontent.com/oguzbilgic/aish/main/install.sh | shThat clones to ~/.zsh-aish and appends one source line to ~/.zshrc. Then set a
provider and open a new terminal:
export ANTHROPIC_API_KEY=sk-ant-... # Claude Haiku (default), or export OPENROUTER_API_KEY=sk-or-... # any OpenRouter model, or # nothing: falls back to Ollama at localhost:11434 (fully local)
A new terminal window is required, not source ~/.zshrc: aish wraps the session in
script(1) to capture command output.
Manual install / plugin managers
Keep aish last in .zshrc, after compinit, autosuggestions and your prompt.
# manual git clone https://github.com/oguzbilgic/aish ~/.zsh-aish source ~/.zsh-aish/aish.plugin.zsh # oh-my-zsh git clone https://github.com/oguzbilgic/aish ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/aish plugins=(... aish) # last in the list # zinit zinit light oguzbilgic/aish # antidote (~/.zsh_plugins.txt) oguzbilgic/aish # zplug zplug "oguzbilgic/aish"
Persistent history makes suggestions much better:
HISTFILE=~/.zsh_history; HISTSIZE=100000; SAVEHIST=100000 setopt share_history inc_append_history extended_history hist_ignore_space
Keys
| Key | Action |
|---|---|
| Tab, →, Ctrl-Space | accept the suggestion (Tab falls through to normal completion when nothing is shown) |
| Alt-A or Ctrl-X A | ask for a suggestion now |
| anything else | dismiss |
Config
Set before the source line.
| Variable | Default | |
|---|---|---|
AISH_PROVIDER |
auto | anthropic, openrouter, ollama; auto picks by which key is set |
AISH_MODEL |
claude-haiku-4-5-20251001 |
Anthropic model |
AISH_OPENROUTER_MODEL |
qwen/qwen-2.5-coder-32b-instruct |
OpenRouter slug, e.g. qwen/qwen3-coder |
AISH_OLLAMA_MODEL |
qwen2.5-coder:7b |
Ollama model |
AISH_ON_SUCCESS |
1 |
0 = only suggest after a command fails |
AISH_DEBOUNCE |
0.4 |
seconds of typing pause before completing |
AISH_MIN_CHARS |
2 |
minimum buffer length to complete |
AISH_MAX_OUT |
60 |
lines of command output sent |
AISH_DEBUG |
set to log every request/response to /tmp/aish.log |
How it works
preexec/precmd hooks record the command and exit status. A shell never sees its
children's stdout, so output is read back from the script transcript (or
tmux capture-pane inside tmux). The request runs in a background process and is
delivered through zle -F; the ghost text is drawn via POSTDISPLAY, the same
primitive zsh-autosuggestions uses (aish yields when autosuggestions is already showing
something). Typing bumps a generation
counter and starts a debounce timer; if you pause, the partial buffer is sent and only
the remainder is shown.
The prompt is small: last command, exit status, last 60 lines of output, 20 history
entries, ls of the cwd, git status --short, and which project files exist
(package.json, Cargo.toml, ...). One request per command with Haiku costs a
fraction of a cent.
Privacy
Everything listed above goes to the provider you configure, after every command.
Prefix a command with a space (hist_ignore_space) to keep it out of history. Use
Ollama for a fully local setup. AISH_DEBUG=1 shows you exactly what is sent.
Uninstall
Remove the source line from ~/.zshrc and rm -rf ~/.zsh-aish.
Re-recording the demo
pip install asciinema curl -Lo agg https://github.com/asciinema/agg/releases/latest/download/agg-$(uname -m)-unknown-linux-gnu && chmod +x agg python3 demo/drive_rec.py # scripted keystrokes; demo/stub.zsh stubs the backend for deterministic timing ./agg --theme dracula --font-size 18 --idle-time-limit 1.5 /tmp/demo.cast aish-demo.gif
License
MIT
