Skip to main content

Explains your terminal errors in plain English. Fully local, no API key.

Project description

๐Ÿ”๏ธ Sherpa

Explains your terminal errors in plain English. Fully local, no API key.

Python 3.10+ License: MIT PyPI


Sherpa Demo

$ python app.py
TypeError: unsupported operand type(s) for +: 'int' and 'str'  [line 42]

$ sherpa

sherpa is thinking...

โ•ญโ”€ Why it failed โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ You're trying to add an integer and a string at line 42.     โ”‚
โ”‚ Python requires both sides of + to be the same type โ€”        โ”‚
โ”‚ it won't auto-convert like JavaScript does.                  โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€ Fix โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ total + int(user_input)                                      โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Install

pip install sherpa-dev

Or from source:

git clone https://github.com/RishiiGamer2201/sherpa
cd sherpa
pip install -e .

First Run

sherpa

On first run, Sherpa will prompt you to download a local AI model (~4GB). After that, everything runs offline โ€” no internet, no API key, no external server. Ever.

Usage

# Explain last terminal error (default)
sherpa

# Explain a specific line in a file
sherpa explain app.py:42

# Ask a freeform question
sherpa ask why is my API returning 403 only in production

# Show current config
sherpa cfg show

# Switch to a different model
sherpa cfg set-model /path/to/custom-model.gguf

Why Sherpa?

Every developer hits errors in their terminal every day. The usual workflow:

  1. Read the error โ†’ feel confused
  2. Copy the error โ†’ open browser โ†’ Google/ChatGPT โ†’ read results โ†’ come back

That's a context switch. You leave your flow, lose your mental state, and waste 3โ€“5 minutes on something that should take 5 seconds.

Sherpa eliminates that loop. The explanation and fix come to you, right where the error happened.

๐Ÿ”’ Your code never leaves your machine. Sherpa runs entirely locally using a quantized AI model. No data is sent anywhere. Ever.

How It Works

sherpa (you type this)
  โ”‚
  โ”œโ”€ config.py    โ†’ checks if model exists
  โ”œโ”€ setup.py     โ†’ downloads model on first run
  โ”œโ”€ history.py   โ†’ reads last command + stderr from shell history
  โ”œโ”€ ai.py        โ†’ loads local model, runs inference
  โ””โ”€ display.py   โ†’ prints explanation + fix with rich styling
Component Library Why
CLI click Clean command routing, auto help text
Output rich Colors, panels, syntax highlighting, progress bars
AI llama-cpp-python Runs .gguf models inline, no server needed
Model CodeLlama 7B Q4 Code-optimized, ~4GB, runs on CPU with 8GB RAM

Supported Models

Model Size Best for
codellama-7b-instruct.Q4_K_M.gguf 4GB Default โ€” code-specific, fast
deepseek-coder-6.7b.Q4_K_M.gguf 4GB Slightly better on debug tasks
mistral-7b-instruct.Q4_K_M.gguf 4GB Good general fallback
gemma-2b-it.Q4_K_M.gguf 1.6GB Low RAM machines (4GB or less)
llama3.2-3b-instruct.Q4_K_M.gguf 2GB Fast, decent quality, mid-range

Switch models anytime:

sherpa cfg set-model /path/to/model.gguf

Comparison

Tool Leaves Terminal? Explains Why? Works Offline? Needs API Key?
Sherpa โŒ No โœ… Yes โœ… Yes โŒ No
Stack Overflow โœ… Yes Sometimes โŒ No โ€”
ChatGPT / Claude โœ… Yes โœ… Yes โŒ No โœ… Yes
GitHub Copilot N/A (IDE) โœ… Yes โŒ No โœ… Yes
thefuck โŒ No โŒ No โœ… Yes โŒ No

Supported Shells

  • โœ… Bash
  • โœ… Zsh
  • โœ… Fish

Requirements

  • Python 3.10+
  • 8GB RAM (for default 7B model)
  • ~4GB disk space for the model

Contributing

See CONTRIBUTING.md for open tasks and guidelines.

License

MIT


Built with Python and llama-cpp-python. Fully local. Your code never leaves your machine.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sherpa_dev-0.1.3.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sherpa_dev-0.1.3-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file sherpa_dev-0.1.3.tar.gz.

File metadata

  • Download URL: sherpa_dev-0.1.3.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for sherpa_dev-0.1.3.tar.gz
Algorithm Hash digest
SHA256 df149249a34e9434d21ba56c7d1d36934a49e34054062365efcc44bd5cbe6119
MD5 6a2dcc81620c2bc9ab3fd5ac353184d9
BLAKE2b-256 5c7976ce19faa20b10991dcbc637496cc26ca718106c1815e2402f23b9cef456

See more details on using hashes here.

File details

Details for the file sherpa_dev-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: sherpa_dev-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for sherpa_dev-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 be4838aaa6ca9f53d4746981ecb1fa02119e6f949a1f7dfdd1208e580991cee6
MD5 006945964b70907c1026ca750971f7af
BLAKE2b-256 bed202a7398d7a2305b5dcd44fbdc2cb9d957350e7481ad1ece13734aedbdb24

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page