An educational, themeable terminal companion framework with a gacha-style pet system. Hatch, raise, and interact with your very own terminal pet!
Live Preview: https://anshmajumdar121.github.io/termipet
TermiPet is an open-source, educational Node.js project inspired by classic Tamagotchi games. It runs entirely in your terminal and teaches concepts like:
- Pseudo-random number generation (Mulberry32 PRNG)
- Deterministic gacha systems (same user always gets the same pet)
- CLI tool design with Node.js
Themeable rendering with chalk
Event-driven architecture
Your pet's species is determined by a seed derived from your user ID β so it's always the same for you, but unique to you!
Rarity Chance Species Common 60% Pebblecrab, Dustbunny, Mossfrog, Twigling, Dewdrop, Puddlefish Uncommon 25% Cloudferret, Gustowl, Bramblebear, Thornfox Rare 10% Crystaldrake, Deepstag, Lavapup Epic 4% Stormwyrm, Voidcat, Aetherling Legendary 1% Cosmoshale, Nebulynx There's also a 1% shiny chance independent of rarity. Good luck! β¨
# Clone the repo git clone https://github.com/anshmajumdar121/termipet.git cd termipet # Install dependencies npm install # Link globally so you can use the 'termipet' command anywhere npm link
Command Description termipet hatchHatch your first TermiPet termipet showDisplay your current pet termipet watchWatch your pet animate live termipet statsShow detailed pet statistics termipet feedFeed your pet termipet playPlay with your pet termipet hatch # Hatch your pet (deterministic - yours is unique to you!) termipet show # See your pet displayed with full stats termipet feed # Feed it! termipet play # Play with it! termipet stats # Full stats breakdown termipet watch # Live animation mode
termipet/ βββ package.json βββ README.md βββ src/ βββ index.js βββ core/ β βββ prng.js # Mulberry32 PRNG engine β βββ hatchery.js # Pet creation & species management β βββ events.js # Event bus system βββ species/ β βββ base.js # Base species class β βββ common.js # Common tier species β βββ uncommon.js # Uncommon tier species β βββ rare.js # Rare tier species β βββ epic.js # Epic tier species β βββ legendary.js # Legendary tier species βββ renderer/ β βββ theme.js # Theme & display system βββ cli/ βββ commands.js # CLI interface themes/ βββ example-theme.js # Example custom theme tests/ βββ test.js # Test suite
Copy
themes/example-theme.jsand modify it to create your own theme:module.exports = { name: 'my-theme', rarityColors: { common: 'blue', legendary: 'red' } };
npm test
PRNG: Uses the Mulberry32 algorithm seeded from your user ID to generate deterministic results
- Hatchery: Weighted random selection across all species/rarities using the PRNG
- Renderer: Chalk-based colorized output with rarity-specific colors
CLI: Node.js switch-based command router with persistent save file at
~/.termipet.json
Pull requests are welcome! To add a new species:
Add your class to the appropriate rarity file in
src/species/
- Register it in
src/core/hatchery.js
Add a test in
tests/test.js
MIT Β© TermiPet Contributors
anshmajumdar121/termipet
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Β | Β | |||
Β | Β | |||
Β | Β | |||
Β | Β | |||
Β | Β | |||
Β | Β | |||
Β | Β | |||
Β | Β | |||