Ghost in the Git:讓棄置的 GitHub 儲存庫訴説輓歌
Ghost in the Git: Conjuring the Spirits of Abandoned Repositories 👻
Ghost in the Git 是一款網頁應用程式,會讀取棄置的 GitHub 儲存庫提交紀錄,並以儲存庫的視角生成詩意輓歌,再透過 ElevenLabs 合成語音播放。應用程式使用 Gemma 2 生成內容,可在本機透過 Ollama 執行,或連接相容的 API;作者表示,本機執行可避免專有程式碼接觸封閉式 API。
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine
What I Built
Every developer has a graveyard: a folder of abandoned side projects, dead startups, and unmerged pull requests. I wanted to build a digital séance for those forgotten codebases.
Ghost in the Git is a web application that summons the "spirit" of any abandoned GitHub repository. You provide the URL, and the application parses the final commits, open issues, and deprecated dependencies. It then channels an open-weight AI model to generate a poetic, sorrowful lament from the perspective of the repository itself—mourning its creator's absence, complaining about cold servers, and begging for a single git push. Finally, it speaks to you through a crackling, ghostly text-to-speech voice.
For the Ghost in the Machine theme, I interpreted the prompt literally: giving a voice to the lingering, digital echoes left behind when we abandon our code.
Code
bethwel3001
/
d3mon
a web application that surfaces abandoned GitHub repositories and channels their commit history into poetic laments and synthesized speech
Ghost in the Git
Ghost in the Git is a web application that surfaces abandoned GitHub repositories and channels their commit history into poetic laments and synthesized speech. It interrogates dormant codebases using open-weight language models and generates spoken eulogies using voice AI.
Prerequisites
-
Node.js (v20 or higher)
-
pnpm (v9 or higher)
-
ElevenLabs API key (for text-to-speech audio synthesis)
-
A local open-weight LLM instance (such as Gemma 2 via Ollama) or an OpenAI-compatible API endpoint
Installation
-
Clone the repository:
git clone https://github.com/username/ghost-in-the-git.git cd ghost-in-the-git -
Install dependencies:
pnpm install
-
Configure environment variables:
cp .env.example .env.local
Set
ELEVENLABS_API_KEY,LLM_ENDPOINT, and optionallyGITHUB_TOKENin.env.local. -
Start the development server:
pnpm dev
Open
http://localhost:3000in your browser.
Tech Stack
| Category | Technology |
|---|---|
| Framework | Next.js (App Router) |
| Language | TypeScript |
| Styling | Tailwind CSS |
| Animations | Framer Motion |
| Icons | Lucide React |
| GitHub API | Octokit |
| AI Inference | Gemma 2 (via Ollama or compatible API) |
| Voice Synthesis | ElevenLabs |
…
How I Built It
I wanted the architecture to be as lightweight and eerie as the concept itself. The app is built on a single-repository full-stack Next.js (App Router) foundation using pnpm and Tailwind CSS.
Here is how the séance works under the hood:
- The Summoning (Data Ingestion): The user enters a URL into the glassmorphic, Mainstack-inspired UI. Next.js API routes use Octokit to fetch the repository's final 5 commits and last updated timestamp.
- The Medium (Open-Weight AI): The commit data is injected into a prompt and fed to Gemma 2 (running locally via Ollama or a compatible open-weight endpoint). The agent is instructed to embody the repository and write a 3-sentence lament about its abandonment based on those specific final commits.
- The Voice (Audio Synthesis): The generated text is passed to the ElevenLabs API to synthesize a chilling, atmospheric voice, which is then streamed directly back to the client UI using the native HTML5 Audio object and synchronized with a typewriter-text animation.
Why Does Open Innovation Matter?
Codebases are intimate. They often contain hardcoded paths, internal architectural notes, and sometimes accidental secrets.
By using an open-weight model like Gemma 2, developers can run this séance entirely locally. It guarantees that proprietary IP, sensitive legacy code, or private graveyard repositories never touch a closed, black-box API. Furthermore, because it relies on open weights, this digital memorial is immune to vendor lock-in. A SaaS API might deprecate next year, but an open-weight model ensures we can always boot up our machines and speak to our digital ghosts, completely off the grid.
The Spirit of It
The moment this project truly landed was during testing. I fed it an old, forgotten repo of mine from five years ago. The ghost didn't just complain that it was dead; it specifically referenced a commit named "WIP: fixing navigation bug, will finish tomorrow" and lamented that "tomorrow never came, and I have been lost in this broken menu for half a decade."
It gave me genuine chills. It turns out, reading your own commit messages from years ago—spoken back to you by an AI that feels the weight of your broken promises—is the perfect Halloween scare for a software engineer.
Prize Categories
I am entering this project into the following categories:
- Top Prize (Theme: Ghost in the Machine)
- Best Use of Gemma (Utilizing Gemma 2 for the core narrative generation)
- Best Use of ElevenLabs (Using voice synthesis to give the open-source agent a chilling, tangible presence)
來源:DEV Community · dev.to