# Troubleshooting Start with the direct command so errors are easy to see: ```bash zsh-ai "show current date" ``` ## API Key Missing ```bash zsh-ai: Warning: ANTHROPIC_API_KEY not set. Plugin will not function. ``` Set the key for your provider: ```bash export ANTHROPIC_API_KEY="your-key" ``` For permanent setup, put the key above the `zsh-ai` load line in a private `~/.zshrc`. Or switch to Ollama: ```bash export ZSH_AI_PROVIDER="ollama" ``` ## Ollama Is Not Reachable ```bash Error: Ollama is not reachable at http://localhost:11434 ``` If Ollama isn't running yet: ```bash ollama serve ollama pull llama3.2 ``` If it's already running, check `ZSH_AI_OLLAMA_URL`. It must be the base URL with no path suffix (`/v1` is for OpenAI-compatible clients, not this plugin): ```bash export ZSH_AI_OLLAMA_URL="http://localhost:11434" ``` ## Nothing Happens With `#` Reload your shell config: ```bash source ~/.zshrc ``` Then test the explicit command: ```bash zsh-ai "list files" ``` If that works, restart your terminal so the zle widget binding reloads. ## Pasting Code Breaks `#` Comments If you paste code blocks that start with `# comment` lines, the inline hook can intercept the first line and fire an unwanted query. Either change the trigger to something you won't paste, or disable the hook and use `zsh-ai "..."` instead: ```bash # Use a different trigger export ZSH_AI_TRIGGER=",," # Or turn the inline hook off entirely export ZSH_AI_COMMENT_HOOK="false" ``` See [INSTALL.md](INSTALL.md#inline-trigger) for details. ## JSON Parse Errors Install `jq`: ```bash brew install jq ``` Ubuntu or Debian: ```bash sudo apt-get install jq ``` ## Still Stuck Check the active provider and model: ```bash zsh-ai ``` Then open an issue with your OS, zsh version, provider, install method, and exact error: https://github.com/matheusml/zsh-ai/issues