A local-first terminal error explainer powered by Ollama.
Project description
errlens
A local-first terminal error explainer. When a command fails, errlens reads the error output and tells you what the error is, why it happened, and how to fix it — all powered by a local Ollama model.
🔒 Privacy first. Your error output never leaves your machine. errlens talks only to a local Ollama server. No cloud, no telemetry.
⚡ Zero dependencies. Pure Python standard library. Responses stream token-by-token so you are not left staring at a blank screen on CPU.
How it works
command fails → capture stderr → local Ollama model → What / Why / How to fix
Requirements
- Python 3.10+
- Ollama installed and running
- A pulled model (default:
qwen2.5:3b, comfortable on CPU)
ollama pull qwen2.5:3b
No GPU needed. On CPU the first response may take a few seconds.
Install
pip install .
This installs the errlens command. Verify your setup any time with:
errlens doctor
Usage
Pipe a failing command's output:
some_command 2>&1 | errlens
Or pass the error text directly:
errlens "ModuleNotFoundError: No module named 'requests'"
Shell integration (the fast path)
Install the err shortcut so you can explain the last failed command without
retyping anything:
errlens install-hook # auto-detects your shell
errlens install-hook zsh # or name it explicitly
Add the printed snippet to your shell profile. Then, whenever a command fails:
$ npm run build # fails
$ err # re-runs it and explains the error
Supported shells: bash, zsh, PowerShell.
Commands
| Command | Description |
|---|---|
errlens [text] |
Explain piped or argument error text (default). |
errlens doctor |
Check Ollama connectivity and model availability. |
errlens install-hook [shell] |
Print the err shell integration snippet. |
Options
| Flag | Description |
|---|---|
-m, --model |
Ollama model to use (default: qwen2.5:3b). |
--raw |
Disable colored output. |
--no-stream |
Wait for the full reply instead of streaming. |
-V, --version |
Show version. |
Environment variables
| Variable | Default | Purpose |
|---|---|---|
ERRLENS_MODEL |
qwen2.5:3b |
Default model. |
ERRLENS_HOST |
http://localhost:11434 |
Ollama endpoint. |
ERRLENS_TIMEOUT |
120 |
Request timeout (seconds). |
Development
pip install -e ".[dev]"
pytest -q
Tests mock the network, so Ollama is not required to run them.
Roadmap
- Automatic shell-hook capture of the last failed command
- Optional cloud backend (Gemini) — local stays the default
- Error history / caching
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file errlens-0.1.0.tar.gz.
File metadata
- Download URL: errlens-0.1.0.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f78a7e7bef782a91a03dfbb459cbbb7b881d47cdd9f4506dc28f0344bca5d15
|
|
| MD5 |
2f1d14b9ad2fbc11166cbba49d8f9bf5
|
|
| BLAKE2b-256 |
00f2945e180017a1b673491c47790e4d0f46baf54ec357ba01c2bdec387d5659
|
File details
Details for the file errlens-0.1.0-py3-none-any.whl.
File metadata
- Download URL: errlens-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d5f4c8f7bc3a331605ea791984923acd9612c57acc2980d9e2a97daaebfc8c3
|
|
| MD5 |
e2be9b1861d902ce2ef7fed42d8c5f3d
|
|
| BLAKE2b-256 |
c6b10bf624f1f7a055b55a8959881d9eb094eb3e66bc0c896c6a4fcc8afe3589
|