The Haunted Terminal — An Offline Ghost in the Machine A developer built The Haunted Terminal, a command-line script that passes each executed command to an AI model and prints back a short, spooky, command-specific response in the voice of a terminal ghost. The demo calls Google's Gemini API, but a 503 high-demand spike at the Hacktoberfest deadline forced a switch to a local open-source model fallback for the recorded demo. The Haunted Terminal. It's a script that hooks into your command line. Every time you run a command, an open-source AI model acts as a "ghost" in the machine, whispering a creepy, customized response based on what you just did. This fits the "Ghost in the Machine" theme perfectly. It brings the idea of a haunted computer to life by giving the terminal a spooky, autonomous personality. Command run: python3 haunted terminal.py "rm -rf /" Ghost's Whisper: "Ah, trying to delete the world with rm -rf /, are we? The abyss is already empty, just like your recycle bin will be. I will be waiting in the dark..." Note: The AI generated this locally, but right at the Hacktoberfest deadline, Google's free API servers were experiencing a massive 503 high-demand spike, so I used a local fallback for the demo. python python import os import sys import requests API KEY = os.environ.get "GEMINI API KEY" URL = f"https://generativelanguage.googleapis.com/v1beta/models/gemini-3.7-flash:generateContent?key={API KEY}" command = " ".join sys.argv 1: if not command: print "šŸ‘» The spirit is sleeping. Pass a command like: python3 haunted terminal.py ls -la" sys.exit prompt = f"""You are a ghost haunting a developer's terminal. The developer just ran this command: '{command}'. Whisper a short, spooky, eerie response in 1 or 2 sentences. Be creepy, but keep it related to what the command actually does.""" payload = {"contents": {"parts": {"text": prompt} } } response = requests.post URL, json=payload data = response.json try: answer = data "candidates" 0 "content" "parts" -1 "text" print f"\nšŸ‘» The Ghost whispers : {answer}\n" except Exception as e: print f"\nError: {e}"