GhostShell:可完全離線運行的幽靈終端
GhostShell: a haunted terminal that runs fully offline
GhostShell 是一款完全離線運行的終端包裝器,會正常執行用戶輸入的命令,再由幽靈角色為執行結果低聲説出一句詭異評語。它以約 30 行 Python 編寫,透過本地 Ollama 伺服器和 llama3.2:1b 生成回覆,資料不會離開用戶的裝置。
This is a submission for the Hacktoberfest Open-Source AI Challenge: Week 4 (Ghost in the Machine).
What I Built
GhostShell is a terminal wrapper that "possesses" your shell. Every command runs normally, then a ghost whispers one eerie sentence about what you just did. It is about 30 lines of Python, and the UI was designed with Figma Make (prompt in the README).
Demo
Run python ghostshell.py, type ls or git status, and read what the spirit says. UI design (Figma Make): https://blush-curl-39070128.figma.site/ . Code: https://github.com/chatgaiyashenanigan-alt/ghostshell
How It Works
The script runs your command with subprocess, then sends the command and its output to a local Ollama server (llama3.2:1b) with a ghost persona prompt. The reply is printed in purple under the output.
Why Open Innovation Matters
Your shell history holds secrets: paths, hostnames, tokens in error messages. A closed API would send all of that to a server you don't control. With an open-weight model, nothing leaves the machine. It works on a plane with the Wi-Fi off, costs nothing per command, and I can swap the model by changing one string. A hosted model could change or disappear, but this ghost stays as long as the weights are on disk.
Designing the UI with Figma Make
I pasted a single prompt (see README) into Figma Make: a marigold-and-violet terminal with fading whisper lines, an offline badge, a model picker, and an "ofrenda" sidebar of past whispers. It gave me a layout I could build from.
來源:DEV Community · dev.to