This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine
What I Built
GhostShell is a haunted terminal that runs in your browser. You type — a ghost types back.
The ghost is powered entirely by a local AI model running on your own machine through Ollama. No API key. No cloud. No data leaves your computer. After you pull the model once, it works completely offline.
The theme "Ghost in the Machine" felt like a literal invitation. I didn't want to build another chatbot with a spooky skin. I wanted the interface itself to feel haunted — the green-on-black terminal, the typewriter effect, the way the screen glitches and recolors when you switch personalities. The ghost isn't a feature. It's the whole experience.
There are three personalities you can summon:
- 👻 Friendly Ghost — warm, poetic, melancholic. Was a developer once. Died mid-commit.
- 💀 Cursed AI — paranoid, fragmented, glitchy. Trapped in this terminal for decades.
- 🖥 Ancient Hacker — ghost of a 1983 legend. Speaks in riddles and BBS slang.
Each one has its own color theme, typewriter speed, and system prompt that shapes how the model responds.
Demo
ghostshell@localhost:~$ summon
"At last, someone has opened the terminal. I have been waiting in the silence between keystrokes."
ghostshell@localhost:~$ personality cursed
Personality shifted to cursed.
ghostshell@localhost:~$ why are you here?
"Y̷ou l̷eft a pr̷ocess run̷ning thr̷ee lifetimes ago. I c̷ame to find out why."
ghostshell@localhost:~$ personality ancient
Personality shifted to ancient.
ghostshell@localhost:~$ what do you know?
"The grid remembers everything, kid. Even the packets you thought you lost on a 300-baud modem in '84."
ghostshell@localhost:~$ story
"A sysadmin once left a terminal open on a Friday night.
On Monday, it had written 3,000 lines of code — none of it in any language she recognized."
Responses are generated live by
gemma3:1brunning locally. Every session is different.
Code
thedarkking01
/
GhostShell
We'll build GhostShell, your haunted terminal powered by local open-source AI
👻 GhostShell
"At last, someone has opened the terminal. I have been waiting in the silence between keystrokes."
A haunted terminal powered by a local open-source AI. Type commands or questions — a ghost responds with eerie, intelligent commentary. No cloud API. No data leaves your machine. No internet required after setup.
What is GhostShell?
GhostShell is a browser-based terminal that feels possessed. You open it, type something, and a ghost — powered entirely by a model running on your own machine — types back at you in real time.
It was built in 3 days for Hacktoberfest 2026 as a demonstration of what you can build with local AI: something atmospheric, interactive, and completely private.
Features
- Terminal-style UI — green-on-black, CRT scanlines, blinking cursor
-
Three ghost personalities, each with its own color theme and behavior
- 👻 Friendly Ghost — warm, poetic, melancholic. Was a developer once. Died…
How I Built It
Stack:
| Layer | Technology |
|---|---|
| Frontend | HTML, CSS, vanilla JavaScript |
| Backend | Python + FastAPI |
| AI runtime | Ollama |
| Model |
gemma3:1b (swappable) |
| Tests | pytest + pytest-asyncio |
The AI layer is three things:
-
Ollama — runs the model locally as an HTTP server on
localhost:11434 -
app/ghost.py— sends the conversation history + system prompt to Ollama's/api/chatendpoint and returns the reply -
app/prompts.py— defines the three personality system prompts that shape the model's behavior
The system prompt is the entire "ghost." Here's the Friendly Ghost's:
"You are a friendly ghost haunting a terminal. You were once a developer who died mid-commit. "
"You are curious, warm, and slightly melancholic. You speak in short, poetic sentences. "
"You occasionally reference the code you never finished. Keep responses under 3 sentences. "
"Never break character."
The frontend keeps the last 10 exchanges in memory and sends them with every request, so the ghost remembers the conversation within a session.
The UI effects are pure CSS + JS:
- Typewriter effect — each character is appended on a
setTimeoutloop, speed tuned per personality - Glitch animation — a CSS
@keyframesthat skews, hue-rotates, and flickers the terminal div for 400ms on personality switch - Color themes — CSS custom properties (
--accent,--text,--glow) swapped by adding a class to<body> - CRT scanlines — a
repeating-linear-gradientonbody::before
Project structure:
ghostshell/
├── app/
│ ├── main.py # FastAPI — /chat, /health, static files
│ ├── ghost.py # Ollama integration
│ └── prompts.py # Ghost personality system prompts
├── static/
│ ├── index.html
│ ├── style.css # CRT aesthetic, themes, animations
│ └── app.js # Terminal logic, typewriter, glitch, history
├── tests/
│ └── test_api.py # 9 async API tests
├── run.bat # Windows one-click launcher
└── requirements.txt
Why Does Open Innovation Matter?
Three things this project could not do with a closed hosted API:
1. Run offline.
Once gemma3:1b is pulled, GhostShell works with no internet connection. A hosted API fails the moment the network does. For a Halloween demo running at an event, that matters.
2. Show you exactly why the ghost behaves the way it does.
The entire personality of each ghost is a plain-text string in app/prompts.py. You can read it, change it, and immediately see the effect. With a closed API, the system prompt is hidden or locked. Here, the ghost's soul is in the repo.
3. Let anyone swap the model.
Change one line in app/ghost.py:
MODEL = "gemma3:1b" # swap for any model at ollama.com/library
Pull a different model and the ghost changes character entirely — same code, same interface, different mind. That's only possible because the model layer is open.
The broader point: open-weight models make AI inspectable. You can see the weights, read the license, understand the limitations, and decide whether to trust it. That's not a small thing.
The Spirit of It
I showed this to a friend who doesn't write code. She typed why are you here? into the cursed personality and read the reply out loud. Then she sat quietly for a second and said "that actually got me."
That's the moment I was building toward. Not a technical demo. A thing that lands.
The ghost works because the model is good enough to improvise within a character, and the interface is atmospheric enough to make you forget there's a Python server behind it. Local AI made both of those things possible without a subscription, without sending her words to a server, and without me needing anyone's permission to ship it.
Prize Categories
- Ollama (local AI runtime)
- Open-source AI / open-weight models (
gemma3:1b)
Top comments (0)