Zsh Ai Cmd
Description
Zsh plugin: natural language to shell commands with AI
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
zsh-ai-cmd
Natural language to shell commands with ghost text preview.

Install
Requires `curl`, `jq`, and an API key for your chosen provider (or a Claude subscription for the `claude-code` provider).
# Clone
git clone https://github.com/kylesnowschwartz/zsh-ai-cmd ~/.zsh-ai-cmd
# Add to .zshrc
source ~/.zsh-ai-cmd/zsh-ai-cmd.plugin.zsh
# Choose your provider (default: anthropic)
export ZSH_AI_CMD_PROVIDER='anthropic' # or: openai, gemini, deepseek, ollama, copilot, claude-code
# Set API key for your chosen provider
export ANTHROPIC_API_KEY='sk-ant-...'
export OPENAI_API_KEY='sk-...'
export GEMINI_API_KEY='...'
export DEEPSEEK_API_KEY='sk-...'
# Ollama and Copilot need no key (local services)
# Claude Code uses your existing Claude subscription (requires: npm install -g @anthropic-ai/claude-code && claude login)
# Or use macOS Keychain
security add-generic-password -s 'anthropic-api-key' -a "$USER" -w 'sk-ant-...'
Usage
- Type a natural language description
- Press
Ctrl+Zto request a suggestion - Ghost text appears showing the command:
find large files → find . -size +100M - Press
Tabor→to accept, or keep typing to dismiss
When the model sees more than one reasonable approach, the ghost text shows a cycle counter (`⟲ 1/3`) — press `Ctrl+Z` again to cycle through the alternatives, then `Tab` to accept the one showing.
Destructive suggestions (`rm`, `kill`, `sed -i`, history rewrites, …) are tinted red and marked with `⚠` so you notice before accepting. Providers without structured output (`copilot`, `claude-code`) return a single suggestion and can't flag destructive commands.
Configuration
ZSH_AI_CMD_PROVIDER='anthropic' # Provider: anthropic, openai, gemini, deepseek, ollama, copilot, claude-code
ZSH_AI_CMD_KEY='^z' # Trigger key (default: Ctrl+Z)
ZSH_AI_CMD_HIGHLIGHT='fg=8' # Ghost text style (zsh region_highlight format)
ZS
Related Skills
Agency Agents
A complete AI agency at your fingertips - From frontend wizards to Reddit community ninjas, from whimsy inject
AI Firecrawl
🔥 The API to search, scrape, and interact with the web for AI
AI Artifacts Builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web tech
AI CrewAI
Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewA
AI TrendRadar
⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的
AI mem0
| Universal memory layer for AI Agents | 51341 | 221 | 1 |
AI