100% Offline
Inference runs locally through llama-cpp-2 on the Metal GPU. No API keys, no cloud calls, no
network required.
OFFLINE • ON‑DEVICE • APPLE SILICON ONLY
Describe what you want in plain English. Shell Sage runs a Gemma 4 model entirely on your Mac's Metal GPU and hands you the exact shell command — no cloud, no API keys, no data ever leaving your machine.
A local-first companion for your terminal — no accounts, no telemetry, no internet required after setup.
Inference runs locally through llama-cpp-2 on the Metal GPU. No API keys, no cloud calls, no
network required.
sage "find all mp4 files" instantly produces a ready-to-run shell command tailored to your
shell.
sage -e "tar -xzvf archive.tar.gz" breaks any command down flag by flag in plain language.
sage -a "why is the sky blue?" answers general-knowledge questions without leaving the
terminal.
Optionally auto-copies the generated command — just ⌘ + V and press Enter.
The sage --config wizard detects your RAM and recommends the right Gemma 4 model size for
your Mac.
Three modes, one assistant — all running on-device.
sage "…" — turn a plain-English request into a
ready-to-run shell command.
sage -e "…" — get a plain-language, flag-by-flag breakdown
of any command.
sage -a "…" — ask a general-knowledge question, right from
the shell.
Shell Sage suggests — it never executes anything on your behalf.
Your query is fed to a local Gemma 4 model via llama-cpp-2, running on the Metal GPU.
The model returns a raw shell command plus # -prefixed explanatory hints.
Shell Sage prints the command and hints straight to your terminal for you to read.
Optionally copied to your clipboard — press ⌘ + V, then Enter.
Pick Homebrew for the fastest setup, or build from source if you want full control.
brew install mdev64/tap/shell-sage
# 1. Install Xcode Command Line Tools (if not already installed)
xcode-select --install
# 2. Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# 3. Clone and build
git clone https://github.com/mdev64/shell-sage.git
cd shell-sage
cargo build --release
# 4. Put the binary on your PATH
cp target/release/sage /usr/local/bin/sage
Run the setup wizard on first use — it detects your RAM, recommends a model, confirms your shell, and
downloads model weights to ~/.cache/sage/.
sage --config
Then start generating commands:
sage "find all mp4 files"
| Command | What it does |
|---|---|
sage "list files modified today" |
Generate a shell command |
sage -e "ls -la" |
Explain a terminal command |
sage -a "why is the sky blue?" |
Answer a general-knowledge question |
sage --config |
Run the configuration wizard |
sage --help |
Show help |
$ sage "compress all png files in this directory"
$ find . -name "*.png" -exec pngquant --ext .png {} \;
# find: searches the filesystem for files
# -name "*.png": matches files ending in .png
# -exec ...: runs pngquant on each match
✓ Command copied to clipboard. Press '⌘ + V', then press Enter to run.
Settings persist in ~/.cache/sage/config.json and can be changed anytime with
sage --config:
/bin/zsh).# -prefixed explanations.Shell Sage is open source under the MIT License. Contributions are welcome.
src/
main.rs CLI parsing, mode dispatch, output rendering
lib.rs Crate root (public modules)
config.rs Model config, app settings, cache paths
downloader.rs Model download, verification, cleanup
engine.rs Llama model loading and inference
output.rs Parse + sanitize the model's raw output
prompt.rs Prompt templates for each mode
setup.rs The `sage --config` interactive wizard
tests/
*.rs Integration tests (one per source module)
cargo buildcargo run -- "your query"cargo testcargo clippy --all-targetscargo fmtBefore submitting a pull request, make sure the following all pass:
cargo fmt --check
cargo clippy --all-targets
cargo test
main.When filing an issue, please include:
~/.cache/sage/config.json), with any personal info removed