<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Wang Zhe</title>
    <description>The latest articles on DEV Community by Wang Zhe (@wang_zhe_214d0311b3b9c258).</description>
    <link>https://dev.to/wang_zhe_214d0311b3b9c258</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4215613%2F623facfd-82ad-4a27-9fac-7b9b90dc0a91.jpg</url>
      <title>DEV Community: Wang Zhe</title>
      <link>https://dev.to/wang_zhe_214d0311b3b9c258</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/wang_zhe_214d0311b3b9c258"/>
    <language>en</language>
    <item>
      <title>GhostShell: The Terminal Is Haunted, and That Is the Point</title>
      <dc:creator>Wang Zhe</dc:creator>
      <pubDate>Thu, 29 Oct 2026 15:44:49 +0000</pubDate>
      <link>https://dev.to/wang_zhe_214d0311b3b9c258/ghostshell-the-terminal-is-haunted-and-that-is-the-point-do5</link>
      <guid>https://dev.to/wang_zhe_214d0311b3b9c258/ghostshell-the-terminal-is-haunted-and-that-is-the-point-do5</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week4-2026-10-26"&gt;Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;GhostShell is a haunted terminal companion. You type a shell command, and&lt;br&gt;
before anything runs, a ghost explains it: what it does, where it came&lt;br&gt;
from, and whether it is about to hurt you.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; ghostshell explain &lt;span class="s2"&gt;"ls -la"&lt;/span&gt;
python &lt;span class="nt"&gt;-m&lt;/span&gt; ghostshell explain &lt;span class="s2"&gt;"rm -rf /"&lt;/span&gt;
python &lt;span class="nt"&gt;-m&lt;/span&gt; ghostshell seance cobol &lt;span class="s2"&gt;"Who are you?"&lt;/span&gt;
python &lt;span class="nt"&gt;-m&lt;/span&gt; ghostshell &lt;span class="nt"&gt;--interactive&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;rm -rf /&lt;/code&gt; gets a critical warning and a refusal. &lt;code&gt;ls -la&lt;/code&gt; gets a&lt;br&gt;
murmur about a command that has watched directories fill and empty&lt;br&gt;
since 1971. A &lt;code&gt;seance&lt;/code&gt; lets you talk to the ghost of a dead programming&lt;br&gt;
language — COBOL (1959), Fortran (1957), Pascal, APL, BASIC — on your&lt;br&gt;
own machine, with no account and no cloud.&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy6qlamxzzlmu0s1o7xcf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy6qlamxzzlmu0s1o7xcf.png" alt="GhostShell terminal demo" width="798" height="125"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run it with no model installed at all, and it still works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;👻  ghostshell whispers about: rm -rf /
    danger: critical
    lore:   rm (1971, early Unix): removes files.
    The ghost shudders. DO NOT RUN THIS as written.
    [dry-run: nothing was executed.]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With Ollama running locally, the same command is whispered by Gemma 3:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ollama pull gemma3
python &lt;span class="nt"&gt;-m&lt;/span&gt; ghostshell explain &lt;span class="s2"&gt;"grep -r TODO ."&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Repository: &lt;a href="https://github.com/AdjieC/ghostshell" rel="noopener noreferrer"&gt;https://github.com/AdjieC/ghostshell&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ghostshell/core.py&lt;/code&gt; — danger patterns, verified command lore, Ollama client, offline fallback&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ghostshell/cli.py&lt;/code&gt; — &lt;code&gt;explain&lt;/code&gt;, &lt;code&gt;seance&lt;/code&gt;, and the interactive REPL&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tests/test_core.py&lt;/code&gt; — 7 tests, all passing with the standard library only&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Zero third-party dependencies. Python 3.10+.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;Safety was the first design decision, not an afterthought. GhostShell&lt;br&gt;
explains by default and never executes. Execution needs &lt;code&gt;--execute&lt;/code&gt;&lt;br&gt;
&lt;em&gt;and&lt;/em&gt; an explicit &lt;code&gt;y&lt;/code&gt;, and critical commands are refused outright.&lt;br&gt;
Danger detection is rule-based and tested, not left to a model that&lt;br&gt;
might miss &lt;code&gt;rm -rf&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The model path is deliberately boring: a POST to &lt;code&gt;localhost:11434&lt;/code&gt;&lt;br&gt;
(Ollama), default model &lt;code&gt;gemma3&lt;/code&gt;, overridable with &lt;code&gt;GHOSTSHELL_MODEL&lt;/code&gt;.&lt;br&gt;
The prompt hands the model only verified lore from a small table in&lt;br&gt;
&lt;code&gt;core.py&lt;/code&gt;. If a command is not in that table, the ghost says it does&lt;br&gt;
not know its history, instead of inventing one. If Ollama is not&lt;br&gt;
running, the rule engine answers instead. That fallback is the point.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Open Innovation Matters
&lt;/h2&gt;

&lt;p&gt;A closed terminal assistant would send every command you type — your&lt;br&gt;
file names, your servers, your mistakes — to someone else's server,&lt;br&gt;
and stop working when that service changes price or shuts down.&lt;/p&gt;

&lt;p&gt;GhostShell does the opposite. In offline mode your commands never leave&lt;br&gt;
your machine; in Ollama mode they only go to localhost. You can swap&lt;br&gt;
Gemma 3 for another open-weight model tomorrow without rewriting the&lt;br&gt;
tool. It costs nothing to run, and it works with the internet off.&lt;br&gt;
A ghost that needs the cloud is not a ghost. It is a subscription.&lt;/p&gt;

&lt;p&gt;That is also why the project honours the past instead of just being&lt;br&gt;
spooky: Unix commands from 1971, dead languages from 1959, and the&lt;br&gt;
people who wrote them, are still here because their work was open&lt;br&gt;
enough to survive them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Best Use of Gemma: GhostShell's default local model is Gemma 3 via Ollama.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
    </item>
  </channel>
</rss>
