Building a Desktop Pet for an AI Coding Assistant: A Full Open-Source Walkthrough

    This article documents the complete process of building an open-source desktop pet plugin for an AI coding assistant. It covers why "useless" fun projects can outperform practical tools in open source, how to define minimal requirements, design a three-state state machine (idle, processing, done), render pixel art in terminals using Unicode half-block characters, lower installation friction, and document the project for contributors. It also reflects on the human-AI division of labor behind the project and the emotional value of playful open-source software.

    Building a Desktop Pet for an AI Coding Assistant: A Full Open-Source Walkthrough

    Why “Useless” Tools Sometimes Win

    Most developers who have built open-source tools know the feeling: you carefully analyze requirements, design features, write documentation, and publish a release—only for nobody to notice. Meanwhile, seemingly “pointless” little things—a new background image, a tiny character, a short animation—earn real stars and shares in the community.

    There’s a pattern behind this:

    • Practical tools solve pain points, and pain points are scarce. Most developers’ workflows are already filled with existing tools. A new tool has to be noticeably better than the current solution to squeeze in—a very high bar.
    • Fun projects deliver emotional value. They don’t ask users to change any habits. Install it, get a little joy; uninstall it, lose nothing. The decision cost is nearly zero.
    • Fun projects spread on their own. A cute screenshot or an animated GIF gets shared far more easily than a feature list, giving it a much larger reach than comparable practical tools.

    So this time, I decided to build something that “does nothing”: a desktop pet for a command-line AI coding assistant—a pixel-art bookworm character hugging a book.

    Defining Requirements: What Should a Desktop Pet Do?

    Once “do nothing” was settled, the requirements became clear. I set three boundaries:

    1. Status visualization only, no features. Its sole responsibility is to reflect the coding assistant’s current working state through expressions, so the user can tell at a glance what’s happening in the background.
    2. Zero maintenance. No feeding, no nurturing, no persona configuration. Install and use—three expressions on loop, no more, no less.
    3. Never interfere with the main workflow. The coding assistant keeps doing its job; the pet is purely an observer and intercepts no input or output.

    This “subtraction” approach was the most important design decision in the whole project. Many personal projects fail not because they don’t do enough, but because they try to do too much and end up doing nothing well.

    State Machine Design: The Logic Behind Three Expressions

    At its core, the pet is a minimal state machine that maps the assistant’s work cycle to three visual states:

    Assistant State Pet Behavior Meaning
    Idle Hugging a book, captioned “Waiting for you” Session ready, awaiting input
    Processing Looking down, flipping through the book Generating a response or calling tools
    Done Holding the book up and smiling for 8 seconds The current turn has truly finished

    A few details are worth expanding on:

    • The processing state includes a tool hint. While the pet flips through its book, a line of text at its feet shows, in real time, the name of the tool the assistant is currently calling. Without digging through logs, the user can see at a glance whether the current step is reading a file, searching code, or running a command. This quietly improves observability—a bit of practical value beyond “cute.”
    • The done state has a clear timeout. The smile lasts 8 seconds and then automatically returns to idle, ensuring the interface never lingers on a stale state.
    • No celebration on error paths. If a turn is interrupted or execution fails, the pet skips the smile and returns directly to idle. This makes the “book-holding smile” a reliable signal: if she smiles, the turn genuinely completed.
    • Subtasks don’t switch expressions. The assistant sometimes spawns subtasks to work in parallel. The pet follows only the main conversation’s state, preventing the expression from flickering and obscuring progress on the main workflow.

    Even for a “toy,” the state machine is as rigorous as any serious tool: normal paths, error paths, and concurrent paths are all covered, with explicit boundary conditions.

    Rendering: How to Draw a Character in a Terminal

    The pet needs to appear in two environments, so I used two rendering strategies.

    GUI client: full-body pixel art. In a desktop environment, a complete pixel image can be rendered directly—best expressiveness, least effort.

    Terminal: a half-body portrait made of half-block characters. Terminals have no pixel-level rendering capability, so I used Unicode half-block characters (such as ▀ ▄ █ and spaces) stacked vertically to simulate pixels, presenting a half-body image on a 36-column × 16-row grid. The advantages:

    • Plain text with no dependency on any terminal graphics protocol—works in nearly any terminal emulator;
    • Extremely low resource usage, redrawing only a small number of characters on refresh;
    • A single “character-to-pixel mapping table” can translate the design draft cell by cell, making the workflow reproducible.

    The mapping logic looks roughly like this:

    1. Grayscale design draft -> character mapping:
    2. Both cells in foreground color -> '█'
    3. Top cell in foreground color -> '▀'
    4. Bottom cell in foreground color -> '▄'
    5. Both cells in background color -> ' '

    Auto-docking. When the terminal window is wide enough (144 columns or more), the pet automatically appears in the sidebar, avoiding the main output area. On narrower windows, it must be summoned manually, keeping the default experience unaffected.

    Distribution and Installation: Lowering the Barrier

    No matter how good a small project is, every extra installation step loses a batch of users. I prepared two installation paths:

    1. Terminal users: Run the plugin installation command within a session—one line does it. After installation, type the summon command to see her.
    2. GUI client users: Since terminal commands aren’t available, add a plugin marketplace source through the interface menu, then add the plugin from that source—all clicks, no command line.

    A few lessons on installation:

    • Different entry points per environment, but the same plugin package. Users don’t need to understand the underlying differences—whichever environment they install in, they use that entry point.
    • Immediate feedback on first launch. The pet appears right after installation. The faster the positive feedback, the more likely users stick around.
    • Zero configuration by default. No settings panel, no character selection, no “start at boot?” prompt—it’s a finished product out of the box.

    Open Source and Promotion: Documenting the “How It Works”

    After open-sourcing the project, I prepared two layers of documentation:

    • For users who want a different character: The repository includes a character replacement guide documenting the design draft dimensions, character mapping rules, and how expression frames are organized—follow it to swap in any character you like.
    • For users curious about the implementation: How the state machine hooks into the assistant’s lifecycle and how terminal rendering works are covered in code comments and explanatory docs.

    There’s also a tip that works for everyone: if you can’t be bothered to read the docs, just send the repository URL to your AI coding assistant and let it read the code and handle installation and customization for you.

    Notably, most of this plugin’s code was written by an AI coding assistant too. My role was defining the character, designing the state mapping, and reviewing the results—precisely the division of labor that’s becoming increasingly common in personal development today: humans handle taste and judgment; AI handles implementation details. Building a small toy is the easiest entry point for experiencing this kind of collaboration.

    Final Thoughts

    The biggest lesson from this project: an open-source work’s success isn’t strictly correlated with “being useful.” Emotional value, low decision cost, and strong shareability are just as much a part of product strength. If you have a few practical tools that nobody noticed, try going the opposite direction—build something that exists purely to be cute, and open-source it. Even if it only adds a little warmth to a few people’s terminals, that alone makes it worthwhile.