This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine.
What I Built
Meet PhantomShell, a spooky AI companion that lives inside your terminal.
Have you ever wondered what your terminal is really doing when you execute a command? What if a mysterious ghost could explain it to you?
That's the idea behind PhantomShell.
PhantomShell is a local-first AI-powered web application where users can enter shell commands and receive explanations in the voice of a mysterious terminal spirit.
It explains what commands appear to do, highlights meaningful risks, and responds with a little Halloween atmosphere.
For example, enter:
rm -rf old_backups/
And the ghost explains the potential consequences of the command.
One important rule: PhantomShell never executes commands. It only inspects the text you provide.
I interpreted the Ghost in the Machine theme quite literally: what if an intelligent spirit was hiding inside our computers?
Demo
PhantomShell is designed as a locally running web application.
The source code and instructions to run it locally are available in the GitHub repository:
👻 PhantomShell — The Terminal Has a Ghost
A spooky, local-first AI command companion with a polished web interface. Type a shell command and PHANTOM explains what it appears to do, highlights meaningful risks, and replies in a mysterious ghostly voice.
Important: PhantomShell inspects command text only. It never executes shell commands.
Preview
Run it locally and open http://127.0.0.1:8000.
Stack
- Python standard-library HTTP server
- HTML, CSS and vanilla JavaScript
- Ollama local inference
- Default model:
qwen2.5:3b(open-weight)
Requirements
- Python 3.9+
- Ollama
- Enough RAM for the model you choose
Run locally
-
Install Ollama: https://ollama.com/
-
Download the model:
ollama pull qwen2.5:3b
-
Make sure Ollama is running. On most installations, the Ollama app starts its local service automatically.
-
Download/clone this repository and open a terminal in the project directory.
-
Start PhantomShell:
python server.py
On Windows:
py server.py
-
Visit
http://127.0.0.1:8000in your browser.
No pip install step is required.
Configuration
Set environment variables before…
It uses a local model rather than requiring a hosted AI API.
Code
The repository includes the Python backend, frontend, project documentation and setup instructions.
How I Built It
I wanted to build something that combined a spooky user experience with practical AI functionality.
The technology stack includes:
- Python: Backend HTTP server.
- HTML, CSS and JavaScript: Interactive haunted chat interface.
- Ollama: Local model inference.
- Qwen 2.5 3B: Open-weight language model.
- Vanilla JavaScript: Communication between the frontend and backend.
Architecture
User
|
v
PhantomShell UI
(HTML/CSS/JS)
|
v
Python Backend
|
v
Ollama Local API
|
v
Qwen 2.5 3B
|
v
Ghostly Response
The application sends user messages to the local Ollama service, which generates responses using the selected model.
The ghost's personality is controlled through a system prompt that encourages concise, atmospheric explanations while emphasizing command safety.
Why Does Open Innovation Matter?
For PhantomShell, open innovation is not just a technology preference. It is central to the project's purpose.
A traditional hosted AI API would introduce an external dependency for something that can run locally.
Using Ollama and an open-weight model makes several things possible:
1. Privacy
Commands are sent to a local Ollama instance rather than a third-party AI API when using the default localhost configuration.
2. Offline capability
After downloading the model and installing the required software, inference can run without an internet connection.
3. Model freedom
The application can use different compatible models without depending on a single hosted AI provider.
4. Cost control
There are no per-request hosted inference charges or API keys required.
5. Transparency and customization
The source code, system prompt and model configuration can be inspected and modified.
For me, the most interesting part is that the AI doesn't have to live somewhere on the internet. It can live right inside your own machine.
The Spirit of It
Halloween is about things that hide in the darkness.
Developers spend so much time interacting with terminals that I thought it would be fun to imagine one that could talk back.
Not every ghost needs to haunt an abandoned house. Some prefer an abandoned terminal window.
And perhaps, somewhere between a git push and a suspicious rm -rf, there's a little spirit waiting to whisper:
"Are you absolutely sure about that, mortal?"
Built for the Hacktoberfest Open-Source AI Challenge — Week 4: Ghost in the Machine. 👻
Top comments (0)