Get AI-powered suggestions directly in your shell using Ollama. No need for external "suggest" commands. Simply press CTRL + Z to receive intelligent completions and suggestions.
- Seamless integration with your ZSH shell
- Uses locally-run Ollama models for suggestions
- Supports command completions and new command suggestions
- Customizable key binding and model selection
Please ensure you have the following dependencies installed:
-
Clone the repository:
git clone https://github.com/YourUsername/zsh-copilot.git ~/.zsh-copilot -
Add the following line to your
~/.zshrc:source ~/.zsh-copilot/zsh-copilot.plugin.zsh
-
Reload your ZSH configuration:
source ~/.zshrc
You can customize zsh-copilot by setting the following environment variables in your ~/.zshrc:
export ZSH_COPILOT_KEY='^z' # Key to trigger suggestions (default: Ctrl+Z)
export ZSH_COPILOT_OLLAMA_MODEL='llama3.1:8b' # Ollama model to use
export ZSH_COPILOT_SEND_CONTEXT=true # Send shell context to the model
export ZSH_COPILOT_DEBUG=false # Enable debug modeTo see available configurations, run:
zsh-copilot- Start typing a command or describe what you want to do.
- Press
CTRL + Z(or your custom key binding) to get a suggestion. - The suggestion will either complete your current command or propose a new one.
- Type
list all fileand pressCTRL + Zto getls -la - Start with
grep 'warning'and pressCTRL + Zto get additional options like-rn
If you encounter issues:
- Ensure Ollama is running and the specified model is available.
- Check the
/tmp/zsh-copilot.logfile if debug mode is enabled. - Verify that all dependencies are correctly installed.
Contributions are welcome! Please feel free to submit a Pull Request.