Your AI model shouldn't have to think alone. Adorable animated pets that hang out in your terminal while the model works! β¨
Turns Codex spritesheet pets (pet.json + spritesheet.webp) into OpenCode TUI plugins that render the pet in your terminal whenever the model is processing. Because every coder deserves a little companion while they wait. π
# 1. Install
npm install -g opencode-pet
# 2. Generate a pet (or convert your own)
opencode-pet generate
# 3. Plugin setup (pick one)
## Option A β Symlink (recommended)
ln -s "$(npm root -g)/opencode-pet" ~/.config/opencode/plugins/opencode-pet
## Option B β Direct path in ~/.config/opencode/opencode.json:
# { "plugin": ["file:/absolute/path/to/node_modules/opencode-pet"] }
# 4. Open OpenCode β your pet animates while the model thinksopencode-pet adds a small animated pet companion to OpenCode that appears to the right of the session prompt whenever the AI model is busy thinking. It works by:
- π± Curating a library of hand-designed kawaii sprites (cat, fox, ghost, slime, robot, dragon, bunny, octopus, penguin, mushroom)
- π¨ Converting Codex spritesheet pets (
pet.json+spritesheet.webp) into terminal-friendly frames (legacy path) - β¨ Rendering frames in the OpenCode TUI using Unicode block characters (
βββ) with full ANSI color support - π« Animating in sync with the model's busy/idle state
The pet renders inside a fixed 16Γ6 cell box with overflow clipping so it always fits cleanly next to the prompt β no wrapping or doubling. A bundled curated fallback pet ships with the plugin so you see something adorable immediately.
| Pet | Vibe |
|---|---|
| π± Mochi Cat | Chill, observant, always watching your code |
| π¦ Pixel Fox | Sly and curious, loves a good algorithm |
| π» Tiny Ghost | Boo! Just floating by, no harm intended |
| π‘ Blobby Slime | Wobbly, cheerful, loves terminal colors |
| π€ Retro Bot | Beep boop. You're doing great. |
| π Mini Dragon | Tiny flames, big dreams |
| π° Bunny | Soft ears, faster than your build times |
| π Octopus | Many hands, all typing at once |
| π§ Penguin | Slides through your terminal with style |
| π Shroom | Fungi friends don't lie β your code is fine |
Or generate a random pet with opencode-pet generate!
| Command | Description |
|---|---|
opencode-pet sprites |
List bundled curated sprites |
opencode-pet install <id> |
Install a curated sprite as a pet |
opencode-pet generate |
Procedurally generate a random pet |
opencode-pet convert <path> |
Convert a Codex pet spritesheet |
opencode-pet list |
List installed pets |
opencode-pet preview <id> |
Preview a pet in your terminal |
opencode-pet remove <id> |
Remove a pet |
| Flag | Default | Description |
|---|---|---|
-o, --output |
~/.opencode/pets |
Output directory |
--cols |
auto | Grid columns in spritesheet |
--rows |
auto | Grid rows in spritesheet |
--output-width |
40 |
Terminal output width (chars) |
--output-height |
20 |
Terminal output height (chars) |
-c, --color |
truecolor |
Color mode: truecolor, 256, ansi16, mono |
--name |
from pet.json | Override pet ID |
-f, --force |
β | Overwrite existing pet |
--fps |
10 |
Animation frames per second |
Add the plugin to your OpenCode config at ~/.config/opencode/opencode.json (or .opencode/opencode.json for project-scoped install):
ln -s "$(npm root -g)/opencode-pet" ~/.config/opencode/plugins/opencode-petEven with the symlink in place, you must also add the plugin to your opencode.json:
Re-launch OpenCode to pick up the change.
{
"plugin": ["file:$(npm root -g)/opencode-pet"]
}Re-launch OpenCode to pick up the change.
npm install -g opencode-pet{
"plugin": ["opencode-pet"]
}For global installs, the plugin bundles
solid-jsand@opentui/solidso peer dependency resolution is not required.
| Command | What it does |
|---|---|
/pet |
Open the pet picker to switch active pet |
/pet-generate |
Procedurally generate a new pet |
/pet-remove |
Open a picker to delete an installed pet |
/pet-debug |
Show diagnostic info (pet count, active id, KV status) |
opencode-pet/
βββ src/
β βββ cli/index.ts β CLI entry point
β βββ converter/
β β βββ index.ts β Conversion orchestrator
β β βββ spritesheet.ts β Grid detection + frame extraction
β β βββ terminal-art.ts β Frame β ANSI block character conversion
β βββ plugin/
β β βββ index.tsx β OpenCode TUI plugin entry
β β βββ pet-loader.ts β Pet manifest loading + KV storage
β βββ types.ts β Shared type definitions
βββ assets/
β βββ default-pet.json β Bundled fallback pet
βββ scripts/
β βββ build-plugin.mjs β Plugin build script
β βββ generate-default-pet.mjs β Default pet generator
βββ package.json
βββ README.md
- Grid detection β Auto-detects the spritesheet grid (e.g., 8Γ8 for standard Codex format). Override with
--cols/--rows. - Frame extraction β Uses Sharp to slice each frame from the spritesheet.
- Downscaling β Resamples each frame to the target output size using area averaging with alpha compositing.
- Terminal rendering β Each 2Γ1 pixel block becomes a single terminal character cell:
- Both pixels filled β
β(full block) - Top filled, bottom empty β
β(upper half block) - Top empty, bottom filled β
β(lower half block) - Both empty β
(space, transparent)
- Both pixels filled β
- Coloring β Each cell gets ANSI escape codes in the selected color mode. Adjacent cells with the same colors reuse existing codes to minimize output size.
Because waiting for an AI to think shouldn't feel like staring at an empty screen. A pet gives you a tiny visual cue that something is happening, and maybe a smile while you wait. πΎ
- Node.js >= 18 (for CLI)
- OpenCode >= 1.14.0 (for plugin)
MIT
{ "plugin": ["opencode-pet"] }