DEV Community

Jesvin Vijesh S
Jesvin Vijesh S

Posted on AI-assisted

Haunted Terminal

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

I built THE HAUNTED TERMINAL, an AI-powered haunted shell that transforms a traditional command-line interface into an immersive psychological horror experience.

The application features a fictional supernatural entity called UNKNOWN that observes the user's commands, whispers eerie and context-aware messages, remembers previous interactions, and gradually develops its own personality and emotional states.

As users interact with the terminal, the entity's possession level increases, unlocking mysterious events, hidden commands, unexpected messages, and eventually a second entity called THE OTHER.

I interpreted the theme by combining the functionality of a real terminal with the atmosphere of a psychological horror game. Rather than relying entirely on scripted jump scares, I wanted the experience to feel unpredictable and intelligent, as if something were slowly becoming aware inside the computer.

My inspiration came from the idea of an ordinary terminal that begins behaving in ways the user cannot explain. The goal was to make every command feel like a potential interaction with something unknown.

Code

THE HAUNTED TERMINAL

You execute the commands. Something else is listening.

What is implemented

This repository now contains a TypeScript core architecture for an offline-first haunted terminal engine with:

  • Secure app-layer secret command handling (invoke, whoisentity, exorcise, etc.)
  • Shell sandbox guard rails for dangerous commands
  • AI provider abstraction for local Ollama and llama.cpp
  • Structured AI JSON response validation/clamping
  • Entity mood, possession, session memory, and horror event managers
  • SQLite-backed local memory store with sensitive-text redaction

Development

npm install
npm run typecheck
npm test
npm run build
Enter fullscreen mode Exit fullscreen mode

Run

Start the interactive terminal with:

npm start
Enter fullscreen mode Exit fullscreen mode

For development without building first:

npm run dev
Enter fullscreen mode Exit fullscreen mode

Enter shell commands at the haunted> prompt. Use .help for help and .exit to quit.

Secret commands

Secret commands are intercepted before they reach the shell. Enter them as the complete command name:

Command Response
invoke You should not have called me.
whoisentity Reports an
…

How I Built It

I designed the project around open-source AI and local inference, using Ollama as the primary AI runtime and Qwen3 as the preferred open-weight language model.

Ollama allows the application to run AI models locally without requiring paid API services. I also designed the architecture to support llama.cpp and compatible GGUF models as alternative inference options.

The application uses React, TypeScript, Electron, and xterm.js to provide a desktop interface and a real interactive terminal. SQLite handles persistent entity memory, allowing UNKNOWN to remember previous interactions and develop its personality over time.

The AI is integrated through a modular provider architecture that handles model selection, streaming responses, command-context analysis, and structured JSON generation.

I designed several interconnected systems around the AI, including an entity personality engine, emotional state engine, possession progression system, command-aware whisper generator, and supernatural event manager.

A key design decision was separating the AI from the actual shell. The AI only receives sanitized command metadata and generates dialogue; it cannot execute commands or modify the user's system.

The overall goal was to demonstrate how open-source AI and local language models can be used to create an interactive, personalized horror experience while keeping the application private, extensible, and safe.

Why Does Open Innovation Matter?

The Spirit of It

This is my first project created using open-source AI models. So the main goal was exploration.

The spirit of THE HAUNTED TERMINAL is built around the idea that something ordinary can become deeply unsettling when it starts behaving as if it is alive. I wanted to transform a familiar command-line interface into an experience where technology meets psychological horror, curiosity, and the unknown.

At its heart is UNKNOWN, a fictional entity that slowly develops awareness through interactions with the user. It observes commands, remembers encounters, whispers unexpected messages, and gradually reveals its personality. The more time users spend inside the terminal, the more the experience changes.

What makes the project special is that the horror isn't entirely scripted. By incorporating open-source AI, I wanted UNKNOWN to feel less like a collection of predefined responses and more like an evolving digital presence with its own personality, memory, and emotions.

The deeper idea is to blur the line between using a computer and interacting with something that seems to inhabit it. It's not just about frightening the user; it's about creating curiosity, suspense, and the lingering feeling that something is listening.

"You execute the commands. Something else is listening."

Prize Categories

Best Use of GitHub Copilot

Top comments (0)