pet-me-js

A Tamagotchi-style virtual pet for your terminal. TypeScript, evolutions, mini-games, random events, inventory, multiple pets, achievements โ€” zero runtime deps.

pet-me-js ๐Ÿฃ - Virtual Terminal Pet (TypeScript)

A tiny Tamagotchi-style virtual pet that lives right in your terminal.
Built with TypeScript, featuring adorable ASCII art, evolutions, random events, mini-games, inventory, achievements, and more โ€” all with zero runtime dependencies.

โœจ Badges (replace with real ones in your repo):

  • ๐Ÿ“ฆ npm: pet-me-js
  • ๐Ÿ“„ license: MIT
  • ๐ŸŸฆ language: TypeScript

๐ŸŒŸ Features

  • ๐Ÿฃ Evolutions: egg โ†’ baby โ†’ teen โ†’ adult (age & care based)
  • ๐Ÿ˜€ ASCII moods: art changes with happiness, hunger, and sickness
  • ๐ŸŽฒ Random events: find items, mood boosts, occasional sickness
  • โœŠ Mini-game: Rockโ€“Paperโ€“Scissors to boost happiness
  • ๐ŸŽ Inventory: food, toys, meds
  • ๐Ÿ• Multiple pets: hatch, list, switch, rename, release
  • ๐Ÿ† Achievements: 7-day survivor, month keeper, perfect diet, etc.
  • โšก Zero deps: fast install, portable CLI

๐Ÿš€ Install

Try instantly (no install): npx pet-me-js help

Or install globally: npm i -g pet-me-js pet-me help

Note: Package name is pet-me-js; CLI command is pet-me.


๐Ÿ•น๏ธ Command Reference

Use pet-me help (or -h / --help) anytime to see this menu.

pet-me status                 Show pet status
pet-me feed [food|toys]       Feed your pet (default: food)
pet-me play [rock|paper|scissors]
                              Play mini-game (RPS)
pet-me medicate               Use medicine if sick
pet-me hatch [--name NAME]    Hatch a new pet and switch to it
pet-me list                   List all pets
pet-me switch <id|name>       Switch current pet
pet-me rename <name>          Rename current pet
pet-me release [<id|name>]    Release a pet (default: current)
pet-me log [N]                Show last N events (default 20)
pet-me config [key value]     View or set config; keys:
                                hungerRatePerHour, happinessDecayPerHour,
                                healthDecayPerHour, randomEventHourlyChance,
                                notifications
pet-me reset                  Clear ALL data (fresh start)
pet-me help                   Show help
pet-me version                Show version

๐Ÿ“– Examples

npx pet-me-js hatch --name Luna
npx pet-me-js play rock
npx pet-me-js feed
npx pet-me-js medicate
npx pet-me-js list
npx pet-me-js switch <id>
npx pet-me-js config hungerRatePerHour 3

๐Ÿ’พ Data & Storage

Your petโ€™s state is stored in a single JSON file (pets, config, log).

  • ๐Ÿง Linux: ~/.config/pet-me-js/state.json
  • ๐Ÿ macOS: ~/Library/Application Support/pet-me-js/state.json
  • ๐ŸชŸ Windows: %APPDATA%/pet-me-js/state.json

(Future optional build: stored in browser localStorage)


โš™๏ธ Config (tune difficulty)

  • hungerRatePerHour (number)
  • happinessDecayPerHour (number)
  • healthDecayPerHour (number)
  • randomEventHourlyChance (0โ€“1)
  • notifications (boolean; reserved for future desktop alerts)

Example: pet-me config hungerRatePerHour 3 pet-me config randomEventHourlyChance 0.15


๐Ÿ‘ฉโ€๐Ÿ’ป Development

git clone https://github.com/JAYDIPSINH27/pet-me-js
cd pet-me-js
npm i
npm run build
node dist/bin/pet-me.js help

Project Structure

src/ types.ts - Domain types utils.ts - Colors, time, clamps, progress bars ascii.ts - ASCII sprites by stage & mood achievements.ts - Badge logic minigames.ts - Rockโ€“Paperโ€“Scissors storage.ts - Local storage (browser) or file (Node) state.ts - Constructors, load/save, current pet selection engine.ts - Pure simulation (evolve, events, tickOne) actions.ts - User-facing operations + printing help.ts - Central help text for CLI bin/ pet-me.ts - CLI dispatcher (supports help & version)


๐Ÿ”‘ Keywords

pet, virtual-pet, tamagotchi, game, fun, cli, node, javascript, typescript


๐Ÿ“ฆ Versioning & Publishing

We follow SemVer. To publish: npm version 1.0.1 npm publish --access public


๐Ÿ›ฃ๏ธ Roadmap

  • ๐ŸŒ Browser bundle (UMD/ESM)
  • ๐Ÿ”” Desktop notifications
  • ๐ŸŽฎ Additional mini-games
  • ๐Ÿงฉ Plugin API
  • ๐ŸŒ Localization

๐Ÿ“œ License

MIT ยฉ Jaydipsinh Padhiyar