← all repositories
tom-doerr/zsh_codex

Tab completion that phones a friend

A ZSH plugin that turns Ctrl+X into an AI-powered command generator for when you know what you want but not how to type it.

1.7k stars Python Coding Assistants
zsh_codex
Velocity · 7d
+1.0
★ / day
Trend
steady
star history

What it does

You type a comment or vague description in your terminal, hit ^X, and an LLM writes the actual shell command. It works as a ZSH plugin—install via oh-my-zsh or manually, point it at an API key, and start completing commands instead of memorizing flags.

The interesting bit

The plugin is backend-agnostic in a practical, config-file sort of way. The INI format supports OpenAI, Google Gemini, Groq, Mistral, and even self-hosted Ollama, with a services/services.py file defining what each backend needs. That’s more plumbing than most “AI shell tools” bother with.

Key highlights

  • Multiple LLM backends in one config file: switch between [openai_service], [groq_service], or a local [my_ollama] by changing one service = line
  • Optional pre-execution context: set ZSH_CODEX_PREEXECUTE_COMMENT="true" to embed command output (like $(git diff)) directly in your prompt
  • Virtualenv-aware: override ZSH_CODEX_PYTHON to point at the right Python binary when your API client lives in a conda environment
  • Also exists for Fish users at tom-doerr/codex.fish

Caveats

  • The pre-execution context feature carries a blunt warning: it runs your prompt through zsh before sending to the AI, which “could potentially modify your system when you hit ^X”
  • The README notes the AI doesn’t see your current filesystem unless you explicitly pipe context into the prompt

Verdict

Worth a look if you live in ZSH and want Copilot-style completion without leaving the terminal. Skip it if you already have a shell workflow you love, or if “run arbitrary shell before AI call” sounds like a feature you don’t need.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.