- β¨ Overview
- π¬ Launching Process
- π¨ Customization
- π Project Structure
- βοΈ Core Scripts
- π Notes & Error handling
- π Special thanks
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.txtandgifts.jsonin the same directory. - Has minimal UI built using
tviewandtcell. - Has Vim-style navigation: Use
h,j,k,lkeys 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.
Brew (macOS)
- Install
brew install HenryLoM/CliWaifuTamagotchi/cliwt- Run
cliwtAUR (Arch)
- Install
yay -S cliwtor
paru -S cliwt- Run
cliwtGit (Source code)
- Clone repository
git clone https://github.com/HenryLoM/CliWaifuTamagotchi.git
cd CliWaifuTamagotchi- Build app yourself, then run
go build -o cliwt
./cliwt- Or run directly for development
go run main.goπ‘ Notes
- First run creates
~/.config/cliwaifutamagotchi/directory andpalette.json,settings.jsonfiles in it on its own if missing.- On macOS, ensure your terminal supports true color for best rendering.
- Palette
JSON file is in~/.config/cliwaifutamagotchi/; Namedpalette.json
JSON file's structure:
{
"background": "#1e1e2e",
"foreground": "#cdd6f4",
"border": "#cba6f7",
"accent": "#eba0ac",
"title": "#b4befe"
}
Note: default palette is Catppuchin (Mocha).
- Settings
JSON file is in~/.config/cliwaifutamagotchi/; Namedsettings.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.
- Words of encouragement
TXT file is in~/.config/cliwaifutamagotchi/; Namedwords-of-encouragement.txt
Note: It's extensible!
- Gifts
JSON file is in~/.config/cliwaifutamagotchi/; Namedgifts.json
Note: It's extensible!
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
- 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.QueueUpdateDrawviaUIEventsChanthat keeps UI changes in order.
- Helper functions for loading ASCII files.
- Manages UI rendering and widget updates.
-
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.
- Handles the bar and changes emotions of the avatar.
- Handles the happiness scores.
- Loads palette from
~/.config/cliwaifutamagotchi/palette.json. - Creates default palette if missing.
- Provides color application helpers.
- Loads settings from
~/.config/cliwaifutamagotchi/settings.json. - Creates default settings if missing.
- Loads settings from
~/.config/cliwaifutamagotchi/words-of-encouragement.txt. - Restores default encouragements from relative directory if missing.
- Loads settings from
~/.config/cliwaifutamagotchi/gifts.json. - Restores default gifts if missing.
- 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!
- Missing/malformed ASCII files may cause a wrong output; handle carefully if modifying assets inside the structure.
- 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.
- 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.
- 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
yayandparu.
β€΄οΈ Return to the π Table of Contents ‴οΈ