ZSH plugin for AI-powered code completion in the command line
Top 25.6% on SourcePulse
This Zsh plugin integrates OpenAI's Codex and Google's Generative AI (Gemini) into the command line, offering AI-powered code completion based on comments or variable names. It targets Zsh users seeking to streamline command-line development by leveraging large language models for code generation.
How It Works
The plugin utilizes Zsh's ZLE (Zsh Line Editor) widgets to capture user input and trigger AI model calls. It supports multiple backend services, including OpenAI, Google Generative AI, and self-hosted models via Ollama or Groq, configurable through an zsh_codex.ini
file. This flexible backend approach allows users to choose between cloud-based APIs or local model deployments for code completion.
Quick Start & Requirements
pip3 install openai
or pip3 install google-generativeai
or pip3 install boto3
.git clone https://github.com/tom-doerr/zsh_codex.git ~/.oh-my-zsh/custom/plugins/zsh_codex
.zsh_codex
to your Zsh plugins and bindkey '^X' create_completion
.~/.config/zsh_codex.ini
.Highlighted Details
zsh_codex.ini
for multiple AI services.ZSH_CODEX_PREEXECUTE_COMMENT="true"
for context gathering via shell commands.Maintenance & Community
No specific contributor or community links (Discord/Slack) are mentioned in the README.
Licensing & Compatibility
The README does not explicitly state a license. Compatibility for commercial use or closed-source linking is not specified.
Limitations & Caveats
Enabling ZSH_CODEX_PREEXECUTE_COMMENT
runs shell commands before AI prompts, posing a potential security risk if not carefully managed. The plugin is presented as a Zsh plugin, implying Zsh is the primary and potentially only supported shell.
4 months ago
Inactive