Wisp:永不執行指令的終端幽靈
Wisp: A Terminal Ghost That Never Runs Your Commands
Wisp 是以 TypeScript 編寫的 CLI,透過 Ollama 在本機呼叫 Gemma 3 4B,根據用戶提供的指令文字及可選的退出代碼,生成一句友善的靈異風格回應。它不會執行指令、監視 Shell 或讀取 Shell 歷史記錄;使用預設 Ollama 網址時,文字不會傳送至託管模型 API,但若改用遠端伺服器,文字便會傳送到該伺服器。
Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission 👻🌼
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine
What I Built
Wisp is a tiny haunted-terminal companion. Give it command text and, optionally, an exit code; a local open-weight model responds with one spooky-but-friendly line.
I took the challenge's haunted-terminal idea and made the ghost deliberately harmless: Wisp never executes the command, watches the shell, reads shell history, or installs hooks. It only reacts to the text I explicitly pass in. That makes it a little less like possession and a little more like a ghostly rubber duck.
Demo
Wisp is a CLI, so there is no hosted web demo. Here are two real runs:
$ node dist/src/cli.js "git status"
The files whisper of changes you've forgotten...
$ node dist/src/cli.js --exit-code 1 "npm test"
The shadows whisper of unfinished cycles...
Code
How I Built It
Wisp is written in TypeScript for Node.js 22 or newer. It has no runtime npm dependencies. It sends the supplied text and optional exit code to Ollama's local /api/generate endpoint and asks Gemma 3 4B to answer in character. The model response is constrained to a short, single line; the CLI also handles missing models, invalid responses, and server timeouts.
The tests use Node's built-in test runner and a mocked HTTP response, so they don't need a running model. GitHub Actions builds and tests the project across Node 22, 24, and 26.
Why Does Open Innovation Matter?
With the default Ollama URL, inference happens on my machine. After the one-time model download, Wisp can generate its replies without sending command text to a hosted model API or needing an API key. I can also switch the model instead of being locked to one provider.
That local boundary depends on the configuration: if I point OLLAMA_URL at a remote server, the command text goes there instead. And the model's line is creative output, not a report of what the command actually did; Wisp never sees the command's output.
Prize Categories
- Best Use of Gemma: Wisp uses Gemma 3 4B locally through Ollama.
The Spirit of It
A failed test usually gives you a stack trace. Wisp gives you a tiny ghost story instead. Under the spooky voice, it is still just a local model responding to text I chose to share with it.
來源:DEV Community · dev.to