Generate shell commands from natural language using AI.
Supports Ollama (local, free) and Anthropic Claude (cloud, paid).
git clone https://github.com/palaforcade/zchat
cd zchat
go build -o zchatOption 1: Ollama (Default)
# Install Ollama
brew install ollama
# Pull a model
ollama pull qwen2.5-coder:7bOption 2: Anthropic
export ZCHAT_PROVIDER=anthropic
export ANTHROPIC_API_KEY=sk-ant-api03-xxx./zchat <natural language query>Examples:
./zchat list files in current directory
./zchat count lines in README.md
./zchat find all go files modified today
./zchat show disk usage sorted by sizeDefault: Uses Ollama with qwen2.5-coder:7b model.
Environment Variables:
export ZCHAT_PROVIDER=ollama # or "anthropic"
export ANTHROPIC_API_KEY=sk-ant-xxx # for Anthropic
export OLLAMA_URL=http://localhost:11434Config File: ~/.config/zchat/config.yaml
provider: ollama
model: qwen2.5-coder:7b
ollama_url: http://localhost:11434
api_key: sk-ant-xxx # for Anthropic
max_context_lines: 20Dangerous commands require explicit confirmation:
rm -rf /- Recursive deletionsdd if=- Disk operations| sh- Piped shell executiondiskutil- Disk utilities
Configure via dangerous_patterns in config file.
MIT