AI-powered CLI tool that converts natural language commands into bash scripts using OpenRouter AI, with intelligent caching for script reuse.
- Natural Language to Bash: Describe what you want in plain English, get executable bash scripts
- Semantic Caching: Similar prompts automatically reuse cached scripts (no AI calls needed)
- Dry Run Mode: Preview generated scripts before execution
- Script Management: List, run, and delete cached scripts
sudo curl -fsSL https://raw.githubusercontent.com/michalCapo/zashu/main/cmd/zashu-linux-amd64 -o /usr/bin/zashu && sudo chmod +x /usr/bin/zashusudo curl -fsSL https://raw.githubusercontent.com/michalCapo/zashu/main/cmd/zashu-darwin-arm64 -o /usr/local/bin/zashu && sudo chmod +x /usr/local/bin/zashusudo curl -fsSL https://raw.githubusercontent.com/michalCapo/zashu/main/cmd/zashu-darwin-amd64 -o /usr/local/bin/zashu && sudo chmod +x /usr/local/bin/zashuDownload zashu-windows-amd64.exe from releases and add to your PATH.
git clone https://github.com/michalCapo/zashu.git
cd zashu
go build -o zashu .
sudo mv zashu /usr/bin/zashuSet your OpenRouter API key:
# Option 1: Environment variable
export OPENROUTER_API_KEY=your-api-key
# Option 2: Configuration file
zashu config set api_key your-api-keyGet your API key from OpenRouter.
# Change the AI model (default: anthropic/claude-3.5-sonnet)
zashu config set model openai/gpt-4o
# View current configuration
zashu config show# Basic usage - generates and executes after confirmation
zashu restart nginx server
# Dry run - preview script without executing
zashu --dry-run list all docker containers
# Auto-confirm - skip confirmation prompt
zashu -y update system packages# List all cached scripts
zashu list
# Run a cached script by ID
zashu run abc12345
# Delete a cached script
zashu delete abc12345-
First Run: When you run a command like
zashu restart server:- Zashu generates an embedding of your prompt
- Checks cache for similar prompts (>90% similarity)
- If no match, calls OpenRouter AI to generate a bash script
- Shows you the script and asks for confirmation
- Executes the script and caches it for future use
-
Subsequent Runs: When you run a similar command:
- Zashu finds the cached script via semantic similarity
- Runs the cached script directly (no AI call needed)
- Saves API costs and reduces latency
Scripts are stored in ~/.zashu/:
~/.zashu/
├── scripts/ # Cached bash scripts
│ └── abc12345.sh
├── index.json # Prompt -> script mapping with embeddings
└── config.yaml # API key and settings
- Confirmation Prompt: Always shows script before execution (unless
-yflag) - Dry Run Mode: Test script generation without execution
- Transparent Caching: View all cached scripts with
zashu list - Manual Review: Cached scripts are readable
.shfiles
Use at your own risk.
This tool uses AI to generate system commands. While it includes safety features like dry-runs and confirmation prompts, AI can make mistakes. Always review the generated scripts before executing them.
The authors and contributors of Zashu are NOT responsible for any damage, data loss, or system instability caused by the use of this tool. You are solely responsible for the commands you execute on your system.
# System administration
zashu restart nginx server
zashu show disk usage for home directory
zashu find large files over 100MB
# Docker operations
zashu list all running docker containers
zashu stop all docker containers
zashu remove unused docker images
# Git operations
zashu show git log for last 5 commits
zashu create a new git branch called feature-x
# File operations
zashu find all python files modified today
zashu compress logs folder to tar.gzMIT