HauntedShell:讓幽靈評論終端指令
HauntedShell
HauntedShell 是一個只用 Python 標準程式庫的單檔終端工具,每次執行一般 shell 指令後,都會由透過 Ollama 在本機運行的小型開放權重模型留下簡短、詭異的評論。指令會在用戶的電腦上執行,幽靈只作評論,不會自行執行指令;工具無須連接互聯網、使用 API key 或雲端服務。
A terminal that a ghost has moved into.
Run normal shell commands. After each one, a ghost (a small open-weight model running locally with Ollama) whispers a short, creepy comment about what you did.
No internet, no API key, no cloud. One Python file using only the standard library.
Run it
1. Start Ollama and download the ghost's model (one time)
ollama serve
ollama pull qwen2.5:3b
2. Enter the haunted shell
python3 haunted.py
Type exit to leave.
Options
Environment variable
Default
What it does
GHOST_MODEL
qwen2.5:3b
Which Ollama model plays the ghost
OLLAMA_URL
http://localhost:11434
Where Ollama is running
Example: GHOST_MODEL=llama3.2:3b python3 haunted.py
If Ollama isn't running, the ghost uses built-in backup lines, so the shell still works.
Note
Commands really run on your machine, just like in your normal terminal. The ghost only comments; it never runs anything by itself.
來源:DEV Community · dev.to