DEV Community

Shreyashi Kaitke
Shreyashi Kaitke

Posted on

👻 PhantomShell AI — When Your Terminal Starts Talking Back

Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission 👻🌼

Built for Hacktoberfest Open-Source AI Challenge — Week 4: Ghost in the Machine.

What I Built

What if your terminal errors had a ghost living inside them?

Introducing PhantomShell AI — a privacy-first, locally powered AI terminal analyzer that transforms confusing command-line errors into understandable explanations and practical troubleshooting suggestions.

As developers, we've all encountered cryptic errors, missing dependencies, configuration issues, and unexpected terminal behavior. Sometimes, understanding an error takes longer than fixing it.

I wanted to build something that makes this experience easier and a little more interesting.

PhantomShell AI acts like an invisible intelligence living inside your terminal. It observes the errors you share, understands the context, and suggests possible solutions — but never takes control of your system.

Key features

Analyze pasted terminal commands and error messages.

Explain errors in simple, understandable language.

Suggest practical troubleshooting steps.

Add optional spooky commentary.

Automatically discover locally installed Ollama models.

Enable optional local browser history.

Clear saved analysis history whenever needed.

The core principle: PhantomShell analyzes commands but never executes them.

Demo:https://drive.google.com/file/d/1NeWL9lRek6nO7GathmNNEhPzK6n-UwLv/view?usp=sharing

🎥 PhantomShell AI — Working Demo

Watch the complete PhantomShell AI demonstration

The demo showcases:

The haunted terminal interface.

Local Ollama model discovery.

Real AI-powered terminal error analysis.

Troubleshooting suggestions.

Optional history and clear-history functionality.

The demonstration uses local inference with Google's Gemma 4 (gemma4:e2b).

Code

💻 GitHub Repository: https://github.com/shrey04kaitke-sys/PhantomShellAI

The project is built with a modular structure:

analyzer.py — AI analysis and model integration.

server.py — Local Python HTTP server.

index.html — Application interface.

styles.css — Haunted terminal design.

app.js — Frontend interactions.

tests/ — Automated test suite.

README.md — Setup, architecture, privacy, and usage documentation.

LICENSE — MIT License.

How I Built It

PhantomShell AI is built around open-weight AI models using local inference through Ollama.

Technology stack

Python 3.13 — Core application logic.

Ollama — Local model serving and inference.

Gemma 4 (gemma4:e2b) — Primary demonstration model.

Gemma 3 (gemma3:1b) — Additional model tested.

Qwen 2.5 (qwen2.5:3b) — Additional model tested.

HTML, CSS, JavaScript — Frontend.

Python HTTP server — Backend.

Python unittest — Automated testing.

Instead of hardcoding a model, PhantomShell discovers the models available locally through Ollama.

Privacy and safety

Privacy was one of the central design decisions.

No external AI API is required.

Terminal commands are never executed.

AI inference happens locally through Ollama.

Communication with Ollama stays on loopback.

Browser history is disabled by default.

Users can enable or clear their saved history.

AI-generated suggestions are treated as unverified advice.

Testing and verification

PhantomShell AI passed 25 automated tests.

Additional verification included:

Python compilation checks.

JavaScript syntax checks.

Local HTTP endpoint verification.

Ollama model discovery.

Real inference using gemma4:e2b.

Browser verification of history functionality.

Safety testing to confirm that submitted commands are not executed.

Why Does Open Innovation Matter?

Open innovation made PhantomShell AI possible.

Using open-weight models gave me the freedom to experiment with AI-powered developer tooling without depending on proprietary cloud inference APIs.

It allowed me to:

Run AI models locally.

Experiment with different model sizes.

Compare model behavior.

Keep potentially sensitive terminal information on the user's machine.

Build and test AI-powered functionality without requiring paid external inference APIs.

For developer tools, privacy matters. Terminal outputs can contain file paths, configuration details, environment information, and sometimes sensitive data.

Local inference offers developers greater control over how their information is processed.

Open innovation also makes AI experimentation more accessible. Individual developers and students can build meaningful applications using powerful models without having to train a foundation model themselves.

My Agent Session

I used OpenAI Codex as my coding agent throughout the development process.

The development involved:

Environment inspection and architecture planning.

Frontend and backend implementation.

Ollama integration.

Regression testing and debugging.

Privacy and safety verification.

Documentation and GitHub preparation.

The application itself uses local Ollama inference, independently of the coding agent.

The Spirit of It 👻

We've all experienced that moment.

You're working on a project, everything seems fine, and suddenly your terminal throws an error that makes absolutely no sense.

You stare at it. Search for it. Try another command. And sometimes, you still have no idea what happened.

I wanted to turn that frustrating experience into something a little more interesting.

What if your terminal had a ghost that could actually explain what was going wrong?

That's PhantomShell AI.

A ghost that doesn't haunt your system, doesn't execute your commands, and doesn't send your terminal data to external AI services.

It simply helps you understand what your terminal is trying to tell you.

Prize Categories

🏆 Best Use of Gemma

PhantomShell AI uses Google's open-weight Gemma 4 model (gemma4:e2b) through Ollama for local terminal error analysis and troubleshooting.

Built with curiosity, open-source AI, and a little Halloween spirit. 👻

devchallenge #hf26challenge #Hacktoberfest #OpenSource #AI #Gemma #Ollama #Python

Top comments (0)