haunted-shell: a tiny local ghost that whispers about my shell commands
Описание и применение
haunted-shell — локальный инструмент, который добавляет к командам терминала короткие «призрачные» комментарии, используя открытый LLM. Он работает полностью офлайн, не сохраняет команды и не отправляет их в облако.
Задача
Shell commands contain sensitive information; sending them to a cloud API risks privacy. Users want a local, private, offline tool that can add fun commentary without exposing commands.
Результат
The tool provides private, offline, whimsical feedback on shell commands, improving user experience while preserving privacy. It runs on a 2‑core VM with 1.5 B model in 2–5 s per whisper, and can be throttled to reduce CPU usage.
Рабочий процесс
- Set up the tool via pip and optional Ollama pull
- Add the PROMPT_COMMAND hook to ~/.bashrc
- Execute shell commands; the hook captures the last command and exit code
- The hook calls haunt whisper in the background
- The local model generates a short comment
- The comment is printed dim and italic with a 👻 prefix
Доказательства
haunted-shell is a tiny ghost that possesses my terminal. A shell hook watches each command I run, and a small open‑weight model on my own machine whispers back one short, eerie comment.
The first version used the exact same model as lazycommit: Qwen2.5-Coder 0.5B Instruct, about 400 MB. For commit messages it worked well in the Week 3 tests, where it picked the right Conventional Commit type on all three real commits. In the ghost test runs it just repeated the input back like a court stenographer.
On a 2‑core VM with the model on CPU, one whisper took about 2 to 5 seconds.
Because the model is open‑weight and runs on my own machine: Private: with the default configuration, whispers are generated on loopback only and the tool never writes command text to disk.
- Дата записи: 2026-11-02T00:44:04.568Z