MCPcopy Index your code
hub / github.com/HenryLoM/CliWaifuTamagotchi

github.com/HenryLoM/CliWaifuTamagotchi @v1.0.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.2 ↗ · + Follow
44 symbols 113 edges 8 files 37 documented · 84%

Browse by type

Functions 37 Types & classes 7
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

🫂 CliWaifuTamagotchi

Preview: Result


You can turn the avatar to husbando in ~/.config/cliwaifutamagotchi/settings.json!

Husbando

Repo size Commits Last commit License

📑 Table of Contents


✨ Overview

CliWaifuTamagotchi is a terminal-based tamagotchi that:

  • Renders ASCII expressions and clothes.
  • Provides a small set of interactions: Encourage, Gift, Dress Up, Background Mode, Quit.
  • Uses a persistent color palette stored in ~/.config/cliwaifutamagotchi/palette.json.
  • Uses persistent detail settings stored in ~/.config/cliwaifutamagotchi/settings.json.
  • Customize some of the functions editing words-of-encouragement.txt and gifts.json in the same directory.
  • Has minimal UI built using tview and tcell.
  • Has Vim-style navigation: Use h, j, k, l keys for intuitive navigation and selection (Must be enabled in settings.json).

No tons of loops - only one function that repeats itself every 5 seconds. Everything handles and updates according to it.


🎬 Launching Process

Brew (macOS)

  1. Install

bash brew install HenryLoM/CliWaifuTamagotchi/cliwt

  1. Run

bash cliwt


AUR (Arch)

  1. Install

bash yay -S cliwt or bash paru -S cliwt

  1. Run

bash cliwt


Git (Source code)

  1. Clone repository

bash git clone https://github.com/HenryLoM/CliWaifuTamagotchi.git cd CliWaifuTamagotchi

  1. Build app yourself, then run

bash go build -o cliwt ./cliwt

  • Or run directly for development

bash go run main.go


💡 Notes

  • First run creates ~/.config/cliwaifutamagotchi/ directory and palette.json, settings.json files in it on its own if missing.
  • On macOS, ensure your terminal supports true color for best rendering.

🎨 Customization

  1. Palette

JSON file is in ~/.config/cliwaifutamagotchi/ ; Named palette.json

JSON file's structure:

{
  "background": "#1e1e2e",
  "foreground": "#cdd6f4",
  "border": "#cba6f7",
  "accent": "#eba0ac",
  "title": "#b4befe"
}

Note: default palette is Catppuchin (Mocha).

  1. Settings

JSON file is in ~/.config/cliwaifutamagotchi/ ; Named settings.json

JSON file's structure:

{
  "name": "Waifu",
  "defaultMessage": "...",
  "vimNavigation": false,
  "avatarType": "waifu",
  "keys": {
    "encourage": "l",
    "dressup": "2",
    "backgroundMode": "b",
    "quit": "q"
  }
}

Note: try to avoid key overrides when using "vimNavigation": true.

  1. Words of encouragement

TXT file is in ~/.config/cliwaifutamagotchi/ ; Named words-of-encouragement.txt

Note: It's extensible!

  1. Gifts

JSON file is in ~/.config/cliwaifutamagotchi/ ; Named gifts.json

Note: It's extensible!


📂 Project Structure

CliWaifuTamagotchi/
│
├── README.md
├── LICENSE
├── .gitignore
├── go.mod
├── go.sum
├── main.go                             # Main file that launches the project
│
├── screenshots/
│   ├── result.gif
│   ├── reactions.jpg
│   └── husbando-preview.jpg
│
└── utils/
    │
    ├── ascii-arts/
    │   │
    │   ├── waifu/                      # Arts for waifu avatar
    │   │   ├── clothes/...             # ASCII bodies
    │   │   └── expressions/...         # ASCII heads
    │   │
    │   └── husbando/...                # Arts for husbando avatar
    │       ├── clothes/...             # ASCII bodies
    │       └── expressions/...         # ASCII heads
    │
    ├── assets/
    │   └── words-of-encouragement.txt  # List of lines for Encouragement function
    │
    ├── app-utils.go                    # Main helpers
    ├── commands-utils.go               # Functions for the Action Space
    ├── happiness-utils.go              # Happiness scoring system
    ├── palette-handler.go              # Handling palette out of the file
    ├── settings-handler.go             # Handling settings out of the file
    ├── encouragements-handler.go       # Handling encouragements out of the file
    └── gifts-handler.go                # Handling gifts out of the file

⚙️ Core Scripts

main.go

  • Loads ASCII head, blink frames, and body.
  • Displays actions menu: Encourage, Dress Up, Quit.
  • Handles user input (keys and navigation).
  • Queues UI updates safely using app.QueueUpdateDraw via UIEventsChan that keeps UI changes in order.

utils/app-utils.go

  • Helper functions for loading ASCII files.
  • Manages UI rendering and widget updates.

utils/commands-utils.go

  • Implements interactions logic:

  • Encourage: random encouraging phrase + happy frame.

  • GiftMenu: choose gifts, apply happiness, show reaction.
  • DressUp: swaps body/outfit based on selection.
  • BackgroundMode: fills the TUI with Waifu, removing all of the odd elements.
  • Manages UI state and async updates via UIEventsChan.
  • Caches custotmizable files to reduce disk reads.

utils/happiness-utils.go

  • Handles the bar and changes emotions of the avatar.
  • Handles the happiness scores.

utils/palette-handler.go

  • Loads palette from ~/.config/cliwaifutamagotchi/palette.json.
  • Creates default palette if missing.
  • Provides color application helpers.

utils/settings-handler.go

  • Loads settings from ~/.config/cliwaifutamagotchi/settings.json.
  • Creates default settings if missing.

utils/encouragements-handler.go

  • Loads settings from ~/.config/cliwaifutamagotchi/words-of-encouragement.txt.
  • Restores default encouragements from relative directory if missing.

utils/gifts-handler.go

  • Loads settings from ~/.config/cliwaifutamagotchi/gifts.json.
  • Restores default gifts if missing.

📜 Notes & Error handling

Errors:

  • See errors you can't explain? Try to remove ~/.config/cliwaifutamagotchi/ directory (you can do a backup). If it worked, it means customization was updated and there was a conflict.
  • If error remains, leave the issue, we could solve it together!

Warning:

  • Missing/malformed ASCII files may cause a wrong output; handle carefully if modifying assets inside the structure.

Read if you want to contribute:

  • The project lives only because there are people who use it. Let's make sure we build it for people, not to earn another achievement for our profiles.
  • Keep the code clean and constructive.
  • Keep the project PG.
  • Keep the Unix philosophy principle: a program should do one thing and do it well.
  • The two main goals of the project:
  • A TUI that is as customizable as we can make it.
  • A tool that is as lightweight as possible, since the project assumes users leave it running in the background.

Future plans you can help with:

  • More interactions (feeding, timed events, stats).
  • Save selected outfit and preferences.
  • Unit tests and error handling improvements.
  • Custom separate font support (because a lot of people meet problems with visuals with their fonts).
  • Maybe "Pose Mode" - loop animation or specific pose to select and have on the background.
  • Maybe separate module handle stderr so Waifu reacts to the errors you get during your work.
  • Maybe separate module to use a ChatBot.

🛐 Special thanks

  • sutemo — for the amaazing female & male sprites you can see in the project.
  • mininit — for embedding all assets and enabling a clean, pure build process.
  • Ali Medhat — for adding Vim-style navigation.
  • Isaac Hesslegrave — for implementing Arch Linux support via yay and paru.

⤴︎ Return to the 📑 Table of Contents ⤴︎

Core symbols most depended-on inside this repo

Shape

Function 37
Struct 7

Languages

Go100%

Modules by API surface

utils/commands-utils.go10 symbols
main.go7 symbols
utils/settings-handler.go6 symbols
utils/palette-handler.go6 symbols
utils/happiness-utils.go5 symbols
utils/gifts-handler.go5 symbols
utils/encouragements-handler.go3 symbols
utils/app-utils.go2 symbols

For agents

$ claude mcp add CliWaifuTamagotchi \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page