hex

Zsh AI Prompt — AI skill for Claude Code

AI community

Zsh plugin for inline AI-powered shell command generation.

How to install Zsh AI Prompt

This entry records only its repository, not the path inside it, so there is no exact command to give. Open hex/zsh-ai-prompt and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Zsh AI Prompt does

Zsh plugin for inline AI-powered shell command generation.

Alternatives in AI

  • Generative Media Skills — Multi-modal Generative Media Skills for AI Agents (Claude Code, Cursor, Gemini CLI) 3k ★
  • Ante — Ghost in your shell 1.9k ★
  • GPT Image2 Ecommerce — GPT-Image-2 驱动的电商素材一键生成 Claude Code Skill E-commerce image generation skill powered by GPT-Image-2 via Codex C 332 ★

README

zsh-ai-prompt

Zsh plugin that provides an inline AI query mode via ZLE widgets. Press a keybinding to enter AI mode, type a natural language query, and get a shell command back in your buffer — ready to edit or execute.

![Demo](assets/demo.gif)

Installation

Oh My Zsh

git clone https://github.com/hex/zsh-ai-prompt.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-ai-prompt

Add `zsh-ai-prompt` to your plugins in `~/.zshrc`:

plugins=(... zsh-ai-prompt)

Zinit

zinit light hex/zsh-ai-prompt

Antidote

Add to `~/.zsh_plugins.txt`:

hex/zsh-ai-prompt

Antigen

antigen bundle hex/zsh-ai-prompt

Manual

Clone the repo and source the plugin in your `~/.zshrc`:

git clone https://github.com/hex/zsh-ai-prompt.git ~/.zsh/zsh-ai-prompt
source ~/.zsh/zsh-ai-prompt/zsh-ai-prompt.plugin.zsh

Usage

  1. Press Alt-A (default) to enter AI mode
  2. Type your query in plain English (e.g., "find all .log files older than 7 days")
  3. Press Enter to submit — a spinner animates while the AI responds
  4. The AI's response replaces your buffer — press Enter to execute, or edit first
  5. Press Escape or Ctrl-C to cancel at any time

Configuration

Works out of the box with the `claude` CLI installed — no configuration needed. For other backends, set `ZSH_AI_PROMPT_BACKEND` and have the provider's API key in your environment.

All settings are optional and can be set in your `.zshrc` before the plugin loads:

# Backend: claude (default), openai, gemini, ollama
ZSH_AI_PROMPT_BACKEND="claude"

# Keybinding (default: Alt-A)
ZSH_AI_PROMPT_KEYBINDING="^[a"

# System prompt sent with every query
ZSH_AI_PROMPT_SYSTEM_PROMPT="Respond with only the command(s), no explanation."

# Visual styling (region_highlight format)
ZSH_AI_PROMPT_SYMBOL_STYLE="fg=magenta"
ZSH_AI_PROMPT_TEXT_STYLE="fg=242"

# CLI fallback for backends that support it (default: 1)
# When no API key is set, bac