Building a Terminal Pet for an AI Coding Assistant: From State Visualization to Plugin Design

    This article describes a small terminal pet built for an AI coding assistant. It explains why playful projects can attract more attention than practical tools, how a three-state design maps the assistant's run state to visual cues, how the pet is drawn with half-block characters in a terminal, and how it is packaged as a plugin that installs and uninstalls cleanly. It also covers how readers can replace the artwork with their own character.

    1. Why Practical Tools Get Ignored While a Pet Takes Off

    Many developers have had a similar experience. They build a tool that solves a real problem, such as an automation script, a productivity plugin, or a configuration manager, post it to a community, and hear nothing for weeks. Meanwhile, a “useless” toy, such as a new background image for a development environment or a small animation in the command line, gets stars and forks.

    Several factors explain this:

    1. Practical projects face fierce competition. Several mature solutions often already address the same pain point. A new project without a clear advantage is hard to notice.
    2. Fun projects spread at low cost. A screenshot of a small character holding a book can be understood and liked within three seconds. Readers do not need to know what problem it solves.
    3. Emotional value is a real need. Developers spend hours in a terminal each day. A small character that responds to your actions can noticeably reduce the loneliness of typing commands at a black screen. This is not meaningless. It complements developer experience.

    The author’s own experience supports this. Several practical tools went unnoticed, while the only one a stranger forked was a plugin that simply changed the background image. So this time, the author went the other way and built something that does no real work: a pet for a command-line AI coding assistant.

    To be clear, this kind of pet has no functional responsibilities. It does only two things: it looks cute, and it acts as a visual dashboard for the assistant’s running state.

    2. Core Design: A Three-State State Machine

    The pet’s main value is translating the assistant’s abstract running state into intuitive visual signals. The design has three states.

    2.1 Idle

    While the assistant waits for user input, the pet sits quietly holding a book, with a short line of text below it, such as “Waiting for you to speak.” This state tells the user that the current turn has ended and the conversation can continue at any time.

    2.2 Working

    After the user sends a message and the assistant starts processing it, the pet bends its head to read the book. The text below the pet changes to show the name of the tool the assistant is currently calling. This is practical. During long tasks, users do not need to watch a scrolling log. A quick glance at the side panel shows whether the assistant is reading a file or running a command. This is a lightweight form of progress visualization. It carries less information than a full log stream, but it also places much less cognitive load on the user.

    2.3 Done

    When the assistant finishes its answer, the pet raises the book and smiles. It stays in this state for about 8 seconds, then returns to idle. One detail is easy to overlook but matters:

    • If a turn is interrupted or fails, the pet skips the Done state and falls back to idle. The smile is therefore a reliable signal: when the pet smiles, the turn actually completed. In a terminal, truncated output and interrupted processes are common, and a clear success signal helps users avoid misjudging the result.
    • The pet does not change expression when sub-agents are dispatched. Coding assistants often start sub-agents to work in parallel. If the pet reacted to every sub-task, the display would become chaotic. Tying the pet to the main conversation matches how users think about “this turn.”

    Here is the state machine in pseudocode:

    1. state = IDLE
    2. on user_message: state = WORKING
    3. on tool_call(tool): show(tool)
    4. on turn_success: state = DONE; after(8s) -> IDLE
    5. on turn_error/interrupt: state = IDLE # Skips DONE
    6. sub_agent_event: ignore # Follows only the main conversation

    The project also makes a product trade-off: there is no growth system and no persona configuration. Users install the pet and use it right away, and the three expressions are fixed. A growth system would be fun, but it would turn a zero-cost toy into a maintenance burden, which conflicts with the goal of instant enjoyment after installation.

    3. Terminal Rendering: Pixel Art Built from Half-Block Characters

    A terminal is not a graphics environment, so drawing a character requires character art. There are two approaches.

    1. Desktop client environments: These support more capable rendering. The pet can be drawn as full-body pixel art with richer animation frames.
    2. Plain terminal environments: Only characters are available. The project uses half-block characters, such as the Unicode upper and lower half blocks. Each character cell can color its top and bottom halves separately, which effectively doubles the vertical resolution. The final image is a half-body portrait, 36 columns wide and 16 rows tall. The size was chosen deliberately:
    • 36 columns keep the pet from taking over the code area in a typical split-screen layout.
    • 16 rows with half-block rendering equal 32 pixel rows, which is enough to show differences in actions such as turning pages or raising the book.
    • The pet is not sensitive to terminal fonts or themes, because the color mapping is a general scheme that does not depend on a specific color palette.

    The sidebar layout depends on terminal width detection. When the window reaches a certain width, such as 144 columns or more, the pet panel renders on the right. Otherwise, it hides, which prevents layout breakage in narrow terminals. This is a common practice in terminal UI (TUI) development: responsive degradation. A feature can be absent, but it must not break the usability of the main workflow.

    4. Plugin Packaging: Installation and Distribution

    To make the pet easy for others to use, it is packaged as a plugin and distributed through a plugin marketplace. The typical flow is as follows.

    In a terminal, one command completes the installation:

    1. /plugin install <plugin-name> --marketplace <marketplace-id>

    In the desktop client, use the graphical interface. Click the plus button next to the input box, open the Plugins page, add the plugin marketplace source by entering the repository identifier, and then add the specific plugin.

    After installation, type the corresponding command, such as /niang, and the pet appears in the sidebar of the session. The installation does not modify the assistant’s core configuration. Uninstalling removes the pet completely, so the plugin has zero intrusion. This follows a core principle of plugin design: extensions can add features, but they must be easy to add and remove, and they must not interfere with each other.

    5. Want Your Own Character? The Code Is Fully Open Source

    The pet’s artwork and code are fully open source, and the repository includes customization notes. You can:

    1. Replace the pixel art frames to create your own character.
    2. Read the source code to see how the state machine and terminal rendering are implemented.
    3. Skip the code entirely and give the repository address to your AI coding assistant to customize the pet for you. The plugin’s code was itself written by AI, so the human’s role is to define the appearance and verify the result.

    This points to a shift in how people work together. Developers increasingly write less of this kind of glue code by hand and spend more effort deciding what they want and whether the result is correct.

    6. Final Thoughts

    A pet that does no work may look useless, but it demonstrates three things. Emotionally driven design can earn real community attention. State visualization is a part of the AI coding assistant experience that deserves more attention. Plugin-based distribution lets anyone reuse a small toy at zero cost. If you are building a terminal tool, consider this: besides helping users do the work, could it also keep them company while they work?