LeaveNhA / zsh_sodex

An ENHANCED version of a zsh_codex plugin with Guidance and some black-magic.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

⌨️ 🦾 Zsh SOdex forked from Zsh Codex

AI in the command line with Guidance 🌟!

Repository's starts Issues License
Latest commit GitHub repository size

You just need to write a comment or variable name and the AI will write the corresponding code.

What is it?

This is a ZSH plugin that enables you to use OpenAI's powerful SOdex AI in the command line. OpenAI SOdex is the AI that also powers GitHub Copilot. To use this plugin you need to get access to OpenAI's Codex API.

How do I install it?

Manual Installation

  1. Install the OpenAI package.
pip3 install openai guidance
  1. Download the ZSH plugin.
git clone https://github.com/LeaveNhA/zsh_sodex.git ~/.oh-my-zsh/custom/plugins/zsh_sodex
  1. Add the following to your .zshrc file.

Using oh-my-zsh:

    # ZSodex configuration
    function zsodex_config() {
        SODEX_PREFERRED_LLM_MODEL='~/.cache/huggingface/hub/models--TheBloke--stable-code-3b-GGUF/snapshots/53430e2b42177f12f2fe8c844cd47211756ca072/stable-code-3b.Q4_K_M.gguf'
        SODEX_LLAMA_N_GPU=999 # since I have a 64GB ram.
        SODEX_N_THREADS=2 # since I'm on a Apple Silicon based machine.
        SODEX_N_CONTEXT=5000 # For extreme cases.
        SODEX_TEMPERATURE=1 # I like it that way but you can configure it.
    }

    plugins=(zsh_codex)
    bindkey '^X' create_completion
    # Or bind it for Vi mode:
    zvm_bindkey vicmd 'zm' sodex_create_completion

Without oh-my-zsh:

    # in your/custom/path you need to have a "plugins" folder and in there you clone the repository as zsh_codex
    export ZSH_CUSTOM="your/custom/path"
    source "$ZSH_CUSTOM/plugins/zsh_sodex/zsh_sodex.plugin.zsh"
    # You still need config function to set the variables.
    bindkey '^X' create_completion
  1. Run zsh, start typing and complete it using ^X!

Traffic Statistics

About

An ENHANCED version of a zsh_codex plugin with Guidance and some black-magic.

License:MIT License


Languages

Language:Python 84.9%Language:Shell 15.1%