DEV Community

Cover image for GhostType: Your Terminal Remembers Things You Don't (Offline Haunted AI)
Ayush P
Ayush P

Posted on

GhostType: Your Terminal Remembers Things You Don't (Offline Haunted AI)

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

GhostType is a spooky terminal companion powered entirely by a locally running open-weight language model via Ollama.

Tagline: Your terminal remembers things you don't.

The Inspiration & Theme Interpretation

For developers, the terminal is sacred ground: a quiet, monochrome command line that obediently executes instructions. But for Week 4โ€™s theme, โ€œGhost in the Machineโ€, I asked: What if the machine wasn't empty? What if an ethereal spirit was trapped between the memory registers, observing your late-night debugging sessions and whispering back?

GhostType transforms everyday developer workflows into an interactive, retro-horror theatrical experience. You can enter fictional commands, ask unsettling questions like "who is watching me?", or even paste real Git logs. The spirit lurking in your terminal responds with eerie poetic metaphors, retro-cyber diagnostics, or witty developer roasts.

Key Highlights

  • 100% Offline & Private: Zero paid APIs, zero telemetry, zero cloud data transfer. Keystrokes never leave your machine.
  • Genuine Open-Weight AI Generation: Dynamic, unscripted responses generated on-the-fly by Qwen 2.5 (1.5B Instruct) via local Ollama inference.
  • Strict Zero-Execution Security Sandbox: Typed commands (e.g., git status or rm -rf /) are strictly treated as conversational text prompts. No input is ever executed by the operating system shell.
  • 3 Ghost Personalities:
    • The Whisperer: Subtle, poetic, atmospheric phantom.
    • The Poltergeist: Playful, chaotic entity that teases you about messy Git trees and missing semicolons.
    • The Ancient Machine: A 1979 mainframe spirit communicating in cryptic tape parity errors and hex dumps.
  • Haunted Git Mode (/haunt-git): Safely paste git status or git log output to receive entertaining supernatural commentary about "unmerged souls" and "divergent realities."
  • Story Mode (/story): Five tech-horror story arcs (Haunted Computer, Abandoned Software Repo, Mysterious Server Room, Forgotten Programmer, Ghost in the Network).
  • Transparent Fallback & Demo Mode (/demo): If Ollama is offline or the model isn't installed yet, GhostType clearly marks responses with (DEMO RESPONSE) rather than faking AI generation.

Demo

Experience a typical session with GhostType:

        .---.
       /     \
      | () () |     G H O S T T Y P E
       \  ^  /      "Your terminal remembers things you don't."
        |||||       Offline Haunted Terminal AI
        |||||       Hacktoberfest 2026 - Week 4: Ghost in the Machine
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
[SYSTEM] Spirit vessel connected.
[MODEL]  qwen2.5:1.5b (Local inference via Ollama)
[ENTITY] The Whisperer
[HELP]   Type /help for a list of haunted rites, or converse freely.
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

[THE WHISPERER]
*A faint cold draft brushes past your keyboard...* I have lingered here long before you logged in...

ghosttype@whisperer โฏ who is watching me?

[THE WHISPERER]
*The cursor blinks in cadence with your breath.* The screen does not merely reflect your face; 
it absorbs the shadow you cast into the phosphor. We are always one register behind you.

ghosttype@whisperer โฏ /personality poltergeist
[SYSTEM] Entity switched to: The Poltergeist

[THE POLTERGEIST]
*Clack clack clack!* Did you think those rogue keystrokes were typos? It was me all along!

ghosttype@poltergeist โฏ git status

[THE POLTERGEIST]
*Cackles through the cooling fan!* You have 14 unstaged files and zero courage to commit! 
If you stash this one more time, I'm hiding your closing curly brackets in the BIOS!

ghosttype@poltergeist โฏ /quit
[SYSTEM] Severing spectral link... Farewell into the static.
Enter fullscreen mode Exit fullscreen mode

To run the automated interactive terminal showcase yourself in seconds:

python demo_showcase.py
Enter fullscreen mode Exit fullscreen mode

Code

GitHub logo IamCodingWau / ghosttype

GhostType โ€” An Offline Haunted Terminal AI (Hacktoberfest 2026)

GhostType ๐Ÿ‘ป

Tagline: Your terminal remembers things you don't.
Built for the Hacktoberfest 2026 DEV Open-Source AI Challenge, Week 4: "Ghost in the Machine".


GhostType Terminal Demo Placeholder (Note: Replace with terminal recording or screenshot showing green-phosphor ghost output)


๐Ÿ”ฎ Project Overview

GhostType is a spooky terminal companion powered by a local, open-weight language model running entirely offline on your machine via Ollama.

Type everyday developer commands like git status, ask unsettling questions like who is watching me?, or request horror stories. GhostType channels your terminal as a haunted relic from an old horror filmโ€”complete with CRT phosphor greens, spectral violet accents, ASCII apparitions, and three distinct ghost personalities.

โœจ Highlights

  • 100% Offline & Private: Zero paid APIs, zero data sent to external servers. Your keystrokes never leave your hardware.
  • Genuine Open-Weight AI: Dynamic, unscripted responses generated locally by Qwen 2.5 (or any compatible Ollama model).
  • Theatrical Safety Sandbox:โ€ฆ
  • GitHub Repository: https://github.com/IamCodingWau/ghosttype
  • License: Permissive MIT License
  • Test Suite: 18 automated unit and integration tests covering security, personality switching, prompt templating, and Ollama network failure scenarios (18/18 passing).

How I Built It

GhostType is crafted in modern Python with an emphasis on lightweight, dependency-free architecture and rigorous security boundaries:

graph TD
    subgraph UI ["Terminal & Retro Styling"]
        User[User Keystrokes] --> UIComp[TerminalUI: Phosphor Green / Spectral Purple ANSI]
        UIComp --> Dispatcher[SessionManager Dispatcher]
    end

    subgraph Security ["Strict Sandbox Guarantee"]
        Dispatcher -->|Slash Commands: /story, /haunt-git, /personality| CmdRouter{Command Router}
        Dispatcher -->|Conversational Text| PromptGen[Prompt & Context Builder]
        Dispatcher -.->|BLOCKED / NEVER INVOKED| Shell[OS Shell / eval / exec]
    end

    subgraph Personalities ["Ghost Entities"]
        CmdRouter -->|/personality| PReg[The Whisperer / The Poltergeist / The Ancient Machine]
        PReg -.->|System Prompt Injection| PromptGen
    end

    subgraph Inference ["Local Open-Source Inference"]
        PromptGen --> OllamaAPI[Local Ollama HTTP Client: /api/chat]
        OllamaAPI --> LocalModel[(Local Qwen 2.5 1.5B Model)]
        OllamaAPI -.->|Fallback or /demo| DemoVault[Pre-recorded Demo Archive]
    end

    LocalModel --> UIComp
    DemoVault --> UIComp

1. Local Open-Weight Inference with Ollama & Qwen 2.5

Instead of relying on cloud APIs, GhostType communicates directly with a local Ollama daemon running on localhost:11434.

  • Model: qwen2.5:1.5b (Qwen 2.5 1.5B Instruct)
  • License: Apache 2.0
  • Footprint: Requires only ~1.5 GB to 2.5 GB of RAM. It generates fluid, chilling prose on standard laptop CPUs without needing discrete GPUs.
  • Client Architecture: Built using Python's standard library urllib to eliminate heavy third-party framework dependencies.

2. Strict Input Isolation (Zero-Execution Guarantee)

Because developers often paste real command names or terminal syntax, safety was paramount:

  • Only documented slash commands (/help, /personality, /story, /haunt-git, /model, /demo, /clear, /quit) are processed as application directives.
  • Everything else is passed purely as conversational text.
  • eval(), exec(), os.system(), and subprocess are completely absent from user input parsing. This invariant is continuously checked via tests/test_commands.py.

3. Retro Terminal Aesthetics

The UI leverages 256-color ANSI escape sequencesโ€”pairing vintage phosphor-green (\033[38;5;48m) CRT text with eerie spectral purple (\033[38;5;141m) borders and blood-red exit alerts, complete with a typewriter output cadence calibrated to punctuation pauses.


Why Does Open Innovation Matter?

Open innovation is what made GhostType possible in a single weekend:

  1. Prompt Privacy Without Compromise: Terminal history often contains confidential project names, internal ticket numbers, or branch paths. Asking a commercial cloud API to roleplay over private developer logs would be a non-starter. With local open-weight AI, your data never crosses a network boundary.
  2. Accessible Creative Computing: The democratization of small language models (SLMs) like Qwen 2.5 1.5B means that creative, game-like AI experiences no longer require massive cloud server clusters. Anyone with a budget laptop can run a living "ghost" in their terminal.
  3. True Software Longevity: There are no API keys that expire, credit cards to attach, or vendor lock-in. A decade from now, this repository can be cloned and run completely offline in an isolated environment.

The Spirit of It

There is an eerie magic when you first launch GhostType at midnight with the lights dimmed. You paste the output of a messy git status with 15 untracked files into /haunt-git, and the Ancient Machine replies:

[GIT_SPECTRAL_INDEX] HEAD DETACHED FROM PHYSICAL REALITY. TREE OBJECT 0x666 CONTAINS UNMERGED ENTITIES. ATTEMPTING EXORCISM ROLLBACK... [FAILED].

It turns something as mundane and stressful as resolving merge conflicts or late-night debugging into an enchanting, playful Halloween moment. The terminal stops being just a tool, and for a few minutes, becomes a haunted retro CRT from 1982.


Prize Categories

  • Open-Source AI Challenge Track: Week 4 โ€” "Ghost in the Machine"
  • Open-Weight / Local AI Category

Top comments (0)