NoirTerminal:離線、零成本的終端自動化 AI Proxy
NoirTerminal: Your Offline, Zero-Cost Haunted AI Proxy for Terminal Automation
NoirTerminal 是一款開源 shell wrapper proxy,透過本機 AI 模型為終端指令加入互動式恐怖敍事,同時保留原有指令輸出。它使用 LM Studio 在本機執行 qwen2.5-3b-instruct,無須連接雲端,亦可離線運作。
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 NoirTerminal, a haunted shell wrapper proxy that turns an ordinary command-line interface into an interactive horror experience.
When you run standard terminal commands like dir, ls, or git status, NoirTerminal securely executes them in the background, locks the real, uncorrupted output pristine between two hardcoded cryptographic borders (╔═════...═════╗), and uses a local AI model to read your actual file names, changes, and errors to weave blood-curdling atmospheric commentary, emojis, and spooky file-aware horror above and below the output.
I interpreted the "Ghost in the Machine" theme literally: the terminal isn't just executing code anymore—it's possessed by a digital phantom that watches your directories and whispers warnings about your codebase.
Demo
Code
You can check out the complete open-source repository on GitHub:
👉 https://github.com/user4302/NoirTerminal
# A snippet from noir_terminal.py handling pristine output preservation and LLM haunting
box_width = 60
top_border = "╔══════════════════════════════════════════════════════════╗"
bottom_border = "╚══════════════════════════════════════════════════════════╝"
if "top_haunting" in haunting:
print(f"\033[31m{haunting['top_haunting']}\033[0m")
print(f"\033[35m{top_border}\033[0m")
if saved_stdout:
print(saved_stdout, end="")
if saved_stderr:
print(saved_stderr, file=sys.stderr, end="")
print(f"\033[35m{bottom_border}\033[0m")
How I Built It
NoirTerminal is engineered using a robust local, open-source AI stack:
-
Python 3.14+ & `uv
: For ultra-fast dependency management and executing our proxy script (noir_terminal.py`). -
LM Studio & Open-Weight LLMs: Utilizing local inference running
qwen2.5-3b-instructlocally on port1234to ensure zero cloud dependency. -
Configuration Management (
config.json): Decouples model parameters, API endpoints, and token generation settings from core execution logic. -
Shell Integration (
$PROFILE/ Aliases): Seamlessly maps native terminal execution paths so standard commands (dir,git,node) transparently route through the haunted proxy.
Why Does Open Innovation Matter?
Running a tool that intercepts every single command and file path on your local machine presents massive privacy implications. Open innovation and local open-weight models made NoirTerminal possible because:
- Absolute Privacy: My personal project directories, code structures, commit histories, and system error outputs never leave my local machine or get uploaded to third-party proprietary cloud servers.
- Offline Resilience: The digital phantom doesn't vanish if the internet drops—local inference means the haunting works entirely offline.
- Total Customizability: Open-weight models allowed me to prompt-engineer the exact tone, JSON formatting schema, and behavior needed without running into arbitrary safety filters or rate limits imposed by closed APIs.
My Agent Session
N/A
The Spirit of It
Typing commands into a dark terminal window at 2 AM while working on code can already feel a bit eerie. NoirTerminal leans into that developer nostalgia, turning mundane build errors and file checks into an immersive, living story where your code repository feels genuinely alive—and slightly threatening.
Prize Categories
- Open-Source AI (Local Inference / LM Studio integration)
來源:DEV Community · dev.to
