zsh_codex  by tom-doerr

ZSH plugin for AI-powered code completion in the command line

created 3 years ago
1,646 stars

Top 25.6% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

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

  • Install Python packages: pip3 install openai or pip3 install google-generativeai or pip3 install boto3.
  • Clone the plugin: git clone https://github.com/tom-doerr/zsh_codex.git ~/.oh-my-zsh/custom/plugins/zsh_codex.
  • Add zsh_codex to your Zsh plugins and bindkey '^X' create_completion.
  • Configure API keys and models in ~/.config/zsh_codex.ini.
  • Official documentation: https://github.com/tom-doerr/zsh_codex

Highlighted Details

  • Supports OpenAI Codex, Google Gemini, and self-hosted models (Ollama, Groq).
  • Configurable via zsh_codex.ini for multiple AI services.
  • Optional ZSH_CODEX_PREEXECUTE_COMMENT="true" for context gathering via shell commands.
  • Integrates with Zsh's ZLE for seamless command-line completion.

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.

Health Check
Last commit

4 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
20 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.