Skip to main content Skip to navigation
Back to Projects

Termagatchi

A Digital AI Pet That Lives in your Terminal!

PythonTextualGoogle GeminiOpenAIAnthropicOllamaUV
Termagatchi

Overview

Termagatchi started as a joke between productivity and nostalgia: “what if you could have a Tamagotchi in your terminal?” It evolved into a fully interactive command-line companion powered by modern language models.

You feed it, play with it, and chat like it’s your weird little coworker; except under the hood, it’s running an AI-driven game engine, persistent state management, and a real-time Textual UI that turns your terminal into a digital habitat.

Problem

Most AI projects chase complexity with web dashboards, APIs, flashy front-ends. I wanted to do the opposite: build something delightful and deeply technical that lives where developers actually are: the command line.

The goal was to combine:

  • nostalgic interaction (virtual pets),
  • a modern terminal UI,
  • and advanced conversational AI — all without leaving the shell.

Solution

I built Termagatchi using Python 3.11+, Textual, and UV, blending game logic, LLM interaction, and terminal UX into one package.

Core systems:

  • 🤖 AI Personality Engine – Integrates Google Gemini, OpenAI, Anthropic, or local Ollama models.
  • 🎮 Game Loop – Manages hunger, happiness, energy, hygiene, affection, and health in real time.
  • 📊 Persistent Saves – Your pet remembers everything between sessions.
  • 🎨 Textual UI – Responsive, animated, and color-themed interface.
  • ⚙️ Extensible Framework – Modular provider system for AI backends and mechanics.

The whole thing runs locally. No backend, no cloud dependency; just pure Python and a healthy dose of serotonin.

Challenges

The biggest challenge was balancing game feel with AI performance. LLMs are slow compared to a traditional game loop, so I built a hybrid tick system that keeps gameplay responsive while AI tasks run asynchronously. Designing believable personality states, ones that persist and evolve naturally, was another rabbit hole entirely.

Impact

  • Brought AI interaction into the command line in a way that’s actually fun.
  • Demonstrated real-time stateful gameplay over LLM backends.
  • Used by developers and hobbyists as both a demo app and stress relief tool.
  • Laid the groundwork for future “AI pet” experiments and interactive CLIs.

Reflection

Termagatchi is a love letter to the terminal; proof that creativity and code can coexist in a text window. It’s whimsical, a little absurd, and deeply technical under the hood. It taught me a lot about threading, UI design, and how to make AI feel alive instead of just “smart.”

Tech Stack

Python 3.11+, Textual, UV, TOML, LLM APIs (Gemini, OpenAI, Anthropic, Ollama)