oguzbilgic/aish

Warp-style inline AI command suggestions for Zsh in ~300 lines of shell

1

stars

7

commits

Shell

primary language

Sep 9, 2026

updated

README

aish

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, and what it printed, then shows the most likely next command as grey inline text. Tab accepts it. Pause mid-command and it completes what you started.

aish demo

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 | sh

That 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

KeyAction
Tab, →, Ctrl-Spaceaccept the suggestion (Tab falls through to normal completion when nothing is shown)
Alt-A or Ctrl-X Aask for a suggestion now
anything elsedismiss

Config

Set before the source line.

VariableDefault
AISH_PROVIDERautoanthropic, openrouter, ollama; auto picks by which key is set
AISH_MODELclaude-haiku-4-5-20251001Anthropic model
AISH_OPENROUTER_MODELqwen/qwen-2.5-coder-32b-instructOpenRouter slug, e.g. qwen/qwen3-coder
AISH_OLLAMA_MODELqwen2.5-coder:7bOllama model
AISH_ON_SUCCESS10 = only suggest after a command fails
AISH_DEBOUNCE0.4seconds of typing pause before completing
AISH_MIN_CHARS2minimum buffer length to complete
AISH_MAX_OUT60lines of command output sent
AISH_DEBUGset 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

Contributors

oguzbilgic

7 commits

oguzbilgic/aish

Warp-style inline AI command suggestions for Zsh in ~300 lines of shell

1

stars

7

commits

Shell

primary language

Sep 9, 2026

updated

README

aish

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, and what it printed, then shows the most likely next command as grey inline text. Tab accepts it. Pause mid-command and it completes what you started.

aish demo

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 | sh

That 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

KeyAction
Tab, →, Ctrl-Spaceaccept the suggestion (Tab falls through to normal completion when nothing is shown)
Alt-A or Ctrl-X Aask for a suggestion now
anything elsedismiss

Config

Set before the source line.

VariableDefault
AISH_PROVIDERautoanthropic, openrouter, ollama; auto picks by which key is set
AISH_MODELclaude-haiku-4-5-20251001Anthropic model
AISH_OPENROUTER_MODELqwen/qwen-2.5-coder-32b-instructOpenRouter slug, e.g. qwen/qwen3-coder
AISH_OLLAMA_MODELqwen2.5-coder:7bOllama model
AISH_ON_SUCCESS10 = only suggest after a command fails
AISH_DEBOUNCE0.4seconds of typing pause before completing
AISH_MIN_CHARS2minimum buffer length to complete
AISH_MAX_OUT60lines of command output sent
AISH_DEBUGset 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

Contributors

oguzbilgic

7 commits

Languages

Shell

100.0%