ShellGen is an AI-powered command-line assistant that converts natural language into valid shell commands — powered by a local LLM (no API keys, no cloud).
It helps you write shell commands faster, safer, and more intuitively.
-
🧠 Natural Language → Command
Type what you want to do, and ShellGen generates the right command. -
🔒 Private and Offline
Runs entirely on your machine using llama.cpp. -
⚙️ Shell Integration
Works directly in Fish, Bash, or Zsh (customizable key bindings). -
🧩 Command Preview and Confirmation
Lets you see what will run — and warns you about risky commands. -
🚀 Local Model Support
Supports quantized.ggufLlama models for fast, low-RAM inference.
Once published, you’ll be able to install ShellGen via pip:
pip install shellgenIf you’re developing or testing locally:
git clone https://github.com/c137v8/ShellGen.git
cd ShellGen
pip install -e .This installs shellgen as a terminal command in your environment.
You can run ShellGen directly from the terminal:
shellgen "list all files in current directory"Output:
Input: list all files in current directory
Command: ls -la
Run this command? [Y/n]
echo "show disk usage" | shellgenAdd the --no-confirm flag to skip the confirmation prompt(For use with terminal key bindings):
shellgen "show current directory" --no-confirmYou can bind ShellGen to a keyboard shortcut (e.g., Ctrl+G) to generate commands inline.
To bind keys run the following command:
For bash/zsh:
source ./scripts/ai_command.shFor fish:
source ./script/ai_command.fishNow just type your natural language request and press Ctrl+G to turn it into a shell command ✨
When run for the first time, ShellGen creates a configuration file at ~/.config/shellgen
Downloaded models are stored at:
~/.config/shellgen/models/
Alternatively, you can download models from:
python -m venv .venv
source .venv/bin/activate
pip install -e .pytestpython -m buildMIT License © 2025 Ibrahim
Feel free to contribute and enhance!
| Input | Output |
|---|---|
| "find all .py files in this folder" | find . -name '*.py' |
| "check disk usage in human readable format" | du -h --max-depth=1 |
| "start a simple HTTP server" | python3 -m http.server |
- Fine tune custom models so its faster and better ;)
💬 ShellGen