{"slug": "show-hn-aish-warp-style-ai-command-suggestions-in-300-lines-of-zsh", "title": "Show HN: Aish – Warp-style AI command suggestions in 300 lines of Zsh", "summary": "Developer oguzbilgic released Aish, a 300-line Zsh plugin that provides Warp-style AI command suggestions after every shell command, predicting the next command based on failure status, output, and project context. The tool supports Anthropic's Claude Haiku (default), OpenRouter models, or fully local Ollama, and requires only Zsh 5.3+ and curl. Aish is open-source on GitHub and installable via a one-line curl command or popular plugin managers.", "body_md": "Warp-style inline AI command suggestions for Zsh in ~300 lines of shell.\n\nAfter 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.\n\nOne file, ~300 lines of zsh. Dependencies: zsh 5.3+ and curl. Works in any terminal. Nothing is ever executed on your behalf.\n\n```\ncurl -fsSL https://raw.githubusercontent.com/oguzbilgic/aish/main/install.sh | sh\n```\n\nThat clones to `~/.zsh-aish` and appends one `source` line to `~/.zshrc`. Then set a\nprovider and open a new terminal:\n\n```\nexport ANTHROPIC_API_KEY=sk-ant-...     # Claude Haiku (default), or\nexport OPENROUTER_API_KEY=sk-or-...     # any OpenRouter model, or\n# nothing: falls back to Ollama at localhost:11434 (fully local)\n```\n\nA new terminal window is required, not `source ~/.zshrc`: aish wraps the session in\n`script(1)` to capture command output.\n\n## Manual install / plugin managers\n\nKeep aish **last** in `.zshrc`, after `compinit`, autosuggestions and your prompt.\n\n```\n# manual\ngit clone https://github.com/oguzbilgic/aish ~/.zsh-aish\nsource ~/.zsh-aish/aish.plugin.zsh\n\n# oh-my-zsh\ngit clone https://github.com/oguzbilgic/aish ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/aish\nplugins=(... aish)          # last in the list\n\n# zinit\nzinit light oguzbilgic/aish\n\n# antidote  (~/.zsh_plugins.txt)\noguzbilgic/aish\n\n# zplug\nzplug \"oguzbilgic/aish\"\n```\n\nPersistent history makes suggestions much better:\n\n```\nHISTFILE=~/.zsh_history; HISTSIZE=100000; SAVEHIST=100000\nsetopt share_history inc_append_history extended_history hist_ignore_space\n```\n\n| Key | Action | \n|---|---|\n| Tab, →, Ctrl-Space | accept the suggestion (Tab falls through to normal completion when nothing is shown) | \n| Alt-A or Ctrl-X A | ask for a suggestion now | \n| anything else | dismiss | \n\nSet before the `source` line.\n\n| Variable | Default |  | \n|---|---|---|\n| `AISH_PROVIDER` | auto | `anthropic` ,`openrouter` ,`ollama` ; auto picks by which key is set | \n| `AISH_MODEL` | `claude-haiku-4-5-20251001` | Anthropic model | \n| `AISH_OPENROUTER_MODEL` | `qwen/qwen-2.5-coder-32b-instruct` | OpenRouter slug, e.g. `qwen/qwen3-coder` | \n| `AISH_OLLAMA_MODEL` | `qwen2.5-coder:7b` | Ollama model | \n| `AISH_ON_SUCCESS` | `1` | `0` = only suggest after a command fails | \n| `AISH_DEBOUNCE` | `0.4` | seconds of typing pause before completing | \n| `AISH_MIN_CHARS` | `2` | minimum buffer length to complete | \n| `AISH_MAX_OUT` | `60` | lines of command output sent | \n| `AISH_DEBUG` |  | set to log every request/response to `/tmp/aish.log` | \n\n`preexec`/` precmd` hooks record the command and exit status. A shell never sees its\nchildren's stdout, so output is read back from the `script` transcript (or\n`tmux capture-pane` inside tmux). The request runs in a background process and is\ndelivered through `zle -F`; the ghost text is drawn via `POSTDISPLAY`, the same\nprimitive zsh-autosuggestions uses (aish yields when autosuggestions is already showing\nsomething). Typing bumps a generation\ncounter and starts a debounce timer; if you pause, the partial buffer is sent and only\nthe remainder is shown.\n\nThe prompt is small: last command, exit status, last 60 lines of output, 20 history\nentries, `ls` of the cwd, `git status --short`, and which project files exist\n(`package.json`, `Cargo.toml`, ...). One request per command with Haiku costs a\nfraction of a cent.\n\nEverything listed above goes to the provider you configure, after every command.\nPrefix a command with a space (`hist_ignore_space`) to keep it out of history. Use\nOllama for a fully local setup. `AISH_DEBUG=1` shows you exactly what is sent.\n\nRemove the `source` line from `~/.zshrc` and `rm -rf ~/.zsh-aish`.\n\n```\npip install asciinema\ncurl -Lo agg https://github.com/asciinema/agg/releases/latest/download/agg-$(uname -m)-unknown-linux-gnu && chmod +x agg\npython3 demo/drive_rec.py       # scripted keystrokes; demo/stub.zsh stubs the backend for deterministic timing\n./agg --theme dracula --font-size 18 --idle-time-limit 1.5 /tmp/demo.cast aish-demo.gif\n```\n\nMIT", "url": "https://wpnews.pro/news/show-hn-aish-warp-style-ai-command-suggestions-in-300-lines-of-zsh", "canonical_source": "https://github.com/oguzbilgic/aish", "published_at": "2026-09-09 04:49:34+00:00", "updated_at": "2026-09-09 05:20:47.678965+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "artificial-intelligence"], "entities": ["oguzbilgic", "Aish", "Anthropic", "Claude Haiku", "OpenRouter", "Ollama", "Zsh", "GitHub"], "alternates": {"html": "https://wpnews.pro/news/show-hn-aish-warp-style-ai-command-suggestions-in-300-lines-of-zsh", "markdown": "https://wpnews.pro/news/show-hn-aish-warp-style-ai-command-suggestions-in-300-lines-of-zsh.md", "text": "https://wpnews.pro/news/show-hn-aish-warp-style-ai-command-suggestions-in-300-lines-of-zsh.txt", "jsonld": "https://wpnews.pro/news/show-hn-aish-warp-style-ai-command-suggestions-in-300-lines-of-zsh.jsonld"}}