Skip to content

How we all expected GitHub Copilot in the CLI to be. No `suggest` bullshit

Notifications You must be signed in to change notification settings

UnixSafe/zsh-copilot-ollama

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 

Repository files navigation

zsh-copilot

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.

Features

  • 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

Installation

Dependencies

Please ensure you have the following dependencies installed:

Setup

  1. Clone the repository:

    git clone https://github.com/YourUsername/zsh-copilot.git ~/.zsh-copilot
  2. Add the following line to your ~/.zshrc:

    source ~/.zsh-copilot/zsh-copilot.plugin.zsh
  3. Reload your ZSH configuration:

    source ~/.zshrc

Configuration

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 mode

To see available configurations, run:

zsh-copilot

Usage

  1. Start typing a command or describe what you want to do.
  2. Press CTRL + Z (or your custom key binding) to get a suggestion.
  3. The suggestion will either complete your current command or propose a new one.

Examples

  • Type list all file and press CTRL + Z to get ls -la
  • Start with grep 'warning' and press CTRL + Z to get additional options like -rn

Troubleshooting

If you encounter issues:

  1. Ensure Ollama is running and the specified model is available.
  2. Check the /tmp/zsh-copilot.log file if debug mode is enabled.
  3. Verify that all dependencies are correctly installed.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

How we all expected GitHub Copilot in the CLI to be. No `suggest` bullshit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%